Browse code

Merge commit '02ec656af72030eea4f3d63e30b25625cce6a3df'

* commit '02ec656af72030eea4f3d63e30b25625cce6a3df':
wmapro: error out on impossible scale factor offsets

The check is replaced by an assert(), as the condition cannot be
true except through bugs elsewhere (which should have been fixed
already)

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/06/30 20:22:24
Showing 1 changed files
... ...
@@ -439,8 +439,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
439 439
                            + s->sfb_offsets[i][b + 1] - 1) << i) >> 1;
440 440
             for (x = 0; x < num_possible_block_sizes; x++) {
441 441
                 int v = 0;
442
-                while (s->sfb_offsets[x][v + 1] << x < offset)
443
-                    ++v;
442
+                while (s->sfb_offsets[x][v + 1] << x < offset) {
443
+                    v++;
444
+                    av_assert0(v < MAX_BANDS);
445
+                }
444 446
                 s->sf_offsets[i][x][b] = v;
445 447
             }
446 448
         }