X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmss1.c;h=10c2c34eb42792e1078a3e3bd9fedb797ac95a00;hb=bd96c54fe4819b3ca9a975e2083d67f4443c559b;hp=a579d9d9a44999248c162e9516c10f8e4a0de139;hpb=23ce57af3ad684363881cdd66d5724f40963a65c;p=ffmpeg diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index a579d9d9a44..10c2c34eb42 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); @@ -215,7 +218,7 @@ static av_cold int mss1_decode_end(AVCodecContext *avctx) return 0; } -AVCodec ff_mss1_decoder = { +const AVCodec ff_mss1_decoder = { .name = "mss1", .long_name = NULL_IF_CONFIG_SMALL("MS Screen 1"), .type = AVMEDIA_TYPE_VIDEO,