[Ffmpeg-cvslog] r6688 - in trunk: libavcodec/wavpack.c libavformat/wv.c

kostya subversion
Sat Oct 14 07:01:06 CEST 2006


Author: kostya
Date: Sat Oct 14 07:01:05 2006
New Revision: 6688

Modified:
   trunk/libavcodec/wavpack.c
   trunk/libavformat/wv.c

Log:
Move block size check to decoder

Modified: trunk/libavcodec/wavpack.c
==============================================================================
--- trunk/libavcodec/wavpack.c	(original)
+++ trunk/libavcodec/wavpack.c	Sat Oct 14 07:01:05 2006
@@ -388,6 +388,11 @@
     memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
 
     s->samples = LE_32(buf); buf += 4;
+    /* should not happen but who knows */
+    if(s->samples * 2 * avctx->channels > AVCODEC_MAX_AUDIO_FRAME_SIZE){
+        av_log(avctx, AV_LOG_ERROR, "Packet size is too big to be handled in lavc!\n");
+        return -1;
+    }
     s->joint = LE_32(buf) & WV_JOINT; buf += 4;
     s->CRC = LE_32(buf); buf += 4;
     // parse metadata blocks

Modified: trunk/libavformat/wv.c
==============================================================================
--- trunk/libavformat/wv.c	(original)
+++ trunk/libavformat/wv.c	Sat Oct 14 07:01:05 2006
@@ -171,12 +171,6 @@
             return -1;
     }
 
-    samples = LE_32(wc->extra);
-    /* should not happen but who knows */
-    if(samples * 2 * wc->chan > AVCODEC_MAX_AUDIO_FRAME_SIZE){
-        av_log(s, AV_LOG_ERROR, "Packet size is too big to be handled in lavc!\n");
-        return -EIO;
-    }
     if(av_new_packet(pkt, wc->blksize + WV_EXTRA_SIZE) < 0)
         return AVERROR_NOMEM;
     memcpy(pkt->data, wc->extra, WV_EXTRA_SIZE);




More information about the ffmpeg-cvslog mailing list