[FFmpeg-cvslog] r20099 - trunk/libavformat/mpc8.c

reimar subversion
Wed Sep 30 15:35:14 CEST 2009


Author: reimar
Date: Wed Sep 30 15:35:13 2009
New Revision: 20099

Log:
Return an error when the parsed mpc chunk size is negative, otherwise we
might end up in an endless loop where the same chunk is parsed over and over.
Fixes a hang near the end for http://samples.mplayerhq.hu/A-codecs/musepack/sv8/sv8-tags.mpc

Modified:
   trunk/libavformat/mpc8.c

Modified: trunk/libavformat/mpc8.c
==============================================================================
--- trunk/libavformat/mpc8.c	Wed Sep 30 15:01:48 2009	(r20098)
+++ trunk/libavformat/mpc8.c	Wed Sep 30 15:35:13 2009	(r20099)
@@ -250,6 +250,8 @@ static int mpc8_read_packet(AVFormatCont
     while(!url_feof(s->pb)){
         pos = url_ftell(s->pb);
         mpc8_get_chunk_header(s->pb, &tag, &size);
+        if (size < 0)
+            return -1;
         if(tag == TAG_AUDIOPACKET){
             if(av_get_packet(s->pb, pkt, size) < 0)
                 return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list