diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index c18a25951c..0a6d937a0a 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -600,7 +600,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv return AVERROR_INVALIDDATA; // enc. code size = klv_decode_ber_length(pb); - if (size < 32 || size - 32 < orig_size) + if (size < 32 || size - 32 < orig_size || (int)orig_size != orig_size) return AVERROR_INVALIDDATA; avio_read(pb, ivec, 16); avio_read(pb, tmpbuf, 16);