* avoid negative numbers as well
authorZdenek Kabelac <kabi@informatics.muni.cz>
Thu, 31 Oct 2002 20:22:30 +0000 (20:22 +0000)
committerZdenek Kabelac <kabi@informatics.muni.cz>
Thu, 31 Oct 2002 20:22:30 +0000 (20:22 +0000)
Originally committed as revision 1134 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/wmadec.c

index 4fbbe39a4b85a1e51c841b17d4a6739c07017387..7505a9be3d2f9ebc92da6320015739cfa16606dd 100644 (file)
@@ -1282,7 +1282,7 @@ static int wma_decode_superframe(AVCodecContext *avctx,
         s->last_bitoffset = pos & 7;
         pos >>= 3;
         len = buf_size - pos;
-        if (len > MAX_CODED_SUPERFRAME_SIZE) {
+        if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) {
             return -1;
         }
         s->last_superframe_len = len;