diff --git a/libavformat/omadec.c b/libavformat/omadec.c index fd7eb0bf7f..d0cb6d49a7 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -171,7 +171,11 @@ static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, taglen = AV_RB32(&enc_header[pos + 32]); datalen = AV_RB32(&enc_header[pos + 36]) >> 4; - pos += 44 + taglen; + pos += 44; + if (size - pos < taglen) + return -1; + + pos += taglen; if (pos + (((uint64_t)datalen) << 4) > size) return -1;