X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Findeo2.c;h=f1324e4635ae78ee3af87299dc6103c57b5e2e0c;hb=9b4648a2cdeb31bf15eb8e238d34b51fe7ff0b87;hp=c89845233e8a49506d2e1f641840bd0f0a2d2636;hpb=9c1b09f73ec36b2470074358d343d9df999b4bee;p=ffmpeg diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index c89845233e8..f1324e4635a 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -77,6 +77,8 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst for (j = 1; j < height; j++) { out = 0; + if (get_bits_left(&ctx->gb) <= 0) + return AVERROR_INVALIDDATA; while (out < width) { int c = ir2_get_code(&ctx->gb); if (c >= 0x80) { /* we have a skip */ @@ -116,6 +118,8 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_ for (j = 0; j < height; j++) { out = 0; + if (get_bits_left(&ctx->gb) <= 0) + return AVERROR_INVALIDDATA; while (out < width) { c = ir2_get_code(&ctx->gb); if (c >= 0x80) { /* we have a skip */