summaryrefslogtreecommitdiff
path: root/libavcodec/mss2.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-11-05 13:10:07 +0000
committerPaul B Mahol <onemda@gmail.com>2013-11-05 13:19:30 +0000
commite3f384b428351b62c83a19a8b77d93ffd415a124 (patch)
tree28f16614d39fef737beb5aae317c6aecb499f007 /libavcodec/mss2.c
parent82f5c4d737ca6ca5c4b956a048f3b59575db9bc2 (diff)
downloadffmpeg-e3f384b428351b62c83a19a8b77d93ffd415a124.tar.gz
avcodec/mss2: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/mss2.c')
-rw-r--r--libavcodec/mss2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index fcb50e3f09..da9a65a6d3 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -384,7 +384,8 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
s->current_picture_ptr = &s->picture[i];
}
- init_get_bits(&s->gb, buf, buf_size * 8);
+ if ((ret = init_get_bits8(&s->gb, buf, buf_size)) < 0)
+ return ret;
s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL;
@@ -482,7 +483,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
- init_get_bits(&gb, buf, buf_size * 8);
+ if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
+ return ret;
if (keyframe = get_bits1(&gb))
skip_bits(&gb, 7);
@@ -640,7 +642,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ff_mss12_slicecontext_reset(&ctx->sc[1]);
}
if (is_rle) {
- init_get_bits(&gb, buf, buf_size * 8);
+ if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
+ return ret;
if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
c->rgb_pic, c->rgb_stride, c->pal, keyframe,
ctx->split_position, 0,