Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol authored on 2013/11/05 22:10:07... | ... |
@@ -384,7 +384,8 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, |
384 | 384 |
s->current_picture_ptr = &s->picture[i]; |
385 | 385 |
} |
386 | 386 |
|
387 |
- init_get_bits(&s->gb, buf, buf_size * 8); |
|
387 |
+ if ((ret = init_get_bits8(&s->gb, buf, buf_size)) < 0) |
|
388 |
+ return ret; |
|
388 | 389 |
|
389 | 390 |
s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL; |
390 | 391 |
|
... | ... |
@@ -482,7 +483,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, |
482 | 482 |
av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >= |
483 | 483 |
ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8); |
484 | 484 |
|
485 |
- init_get_bits(&gb, buf, buf_size * 8); |
|
485 |
+ if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0) |
|
486 |
+ return ret; |
|
486 | 487 |
|
487 | 488 |
if (keyframe = get_bits1(&gb)) |
488 | 489 |
skip_bits(&gb, 7); |
... | ... |
@@ -640,7 +642,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, |
640 | 640 |
ff_mss12_slicecontext_reset(&ctx->sc[1]); |
641 | 641 |
} |
642 | 642 |
if (is_rle) { |
643 |
- init_get_bits(&gb, buf, buf_size * 8); |
|
643 |
+ if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0) |
|
644 |
+ return ret; |
|
644 | 645 |
if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride, |
645 | 646 |
c->rgb_pic, c->rgb_stride, c->pal, keyframe, |
646 | 647 |
ctx->split_position, 0, |