X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmss1.c;h=7af8024d63d1f6e2220898fcacf7aaa10d5bdc1c;hb=252500a78fe1a31abc79e6070d16f50382c39343;hp=a579d9d9a44999248c162e9516c10f8e4a0de139;hpb=ff44c2d4f483cda53859ce019f3815c69239a7e0;p=ffmpeg diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index a579d9d9a44..7af8024d63d 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -56,6 +56,8 @@ static void arith_normalise(ArithCoder *c) c->low <<= 1; c->high <<= 1; c->high |= 1; + if (get_bits_left(c->gbc.gb) < 1) + c->overread++; c->value |= get_bits1(c->gbc.gb); } } @@ -112,6 +114,7 @@ static void arith_init(ArithCoder *c, GetBitContext *gb) c->low = 0; c->high = 0xFFFF; c->value = get_bits(gb, 16); + c->overread = 0; c->gbc.gb = gb; c->get_model_sym = arith_get_model_sym; c->get_number = arith_get_number; @@ -151,7 +154,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, arith_init(&acoder, &gb); - if ((ret = ff_reget_buffer(avctx, ctx->pic)) < 0) + if ((ret = ff_reget_buffer(avctx, ctx->pic, 0)) < 0) return ret; c->pal_pic = ctx->pic->data[0] + ctx->pic->linesize[0] * (avctx->height - 1);