diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 261c651b52..2d199971c4 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -888,8 +888,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx, if (ctx->data_size == 16) return 4; - if (ctx->data_size > buf_size) - ctx->data_size = buf_size; + ctx->data_size = FFMIN(ctx->data_size, buf_size - 16); buf_ptr += 3; // skip reserved byte and checksum