X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Findeo2.c;h=09cb560d8eff3fae7f1d88f217f6c4720cc5940c;hb=1046e880884bb5f0da4fb7d50028ff599550245c;hp=4971b84308f850a248792cb13507392f51d3cf6e;hpb=c0a647644f2703e1da980dcf988cefd81528d8c9;p=ffmpeg diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 4971b84308f..09cb560d8ef 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -56,7 +56,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst int j; int out = 0; - if (width & 1) + if ((width & 1) || width * height / (2*(IR2_CODES - 0x7F)) > get_bits_left(&ctx->gb)) return AVERROR_INVALIDDATA; /* first line contain absolute values, other lines contain deltas */