aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-11-05 12:50:43 +0000
committerPaul B Mahol <onemda@gmail.com>2013-11-05 13:19:30 +0000
commitb79f543c58691d21e9b5ec45be55d38b5e2e0c8d (patch)
tree942d48e7c2222ef41d07ea04fd3107b21e148f54
parent2a6c95d85f9828d82a793b8c02f7c96ae0c24b4e (diff)
downloadffmpeg-b79f543c58691d21e9b5ec45be55d38b5e2e0c8d.tar.gz
avcodec/mss1: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavcodec/mss1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
index 46ea2b55d6..3e24d79e4c 100644
--- a/libavcodec/mss1.c
+++ b/libavcodec/mss1.c
@@ -139,8 +139,6 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
MSS1Context *ctx = avctx->priv_data;
MSS12Context *c = &ctx->ctx;
GetBitContext gb;
@@ -148,7 +146,9 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
int pal_changed = 0;
int ret;
- init_get_bits(&gb, buf, buf_size * 8);
+ if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
+ return ret;
+
arith_init(&acoder, &gb);
if ((ret = ff_reget_buffer(avctx, &ctx->pic)) < 0)
@@ -182,7 +182,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
*got_frame = 1;
/* always report that the buffer was completely consumed */
- return buf_size;
+ return avpkt->size;
}
static av_cold int mss1_decode_init(AVCodecContext *avctx)