diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 0237b44784..310036b0cd 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -199,7 +199,7 @@ static int decode_frame(AVCodecContext *avctx, for (i=0; idata[i]; - if (total_size > avpkt->size) { + if (total_size + (int64_t)offset > avpkt->size) { av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n"); return AVERROR_INVALIDDATA; }