changeset 5241:da61aef912cb libavformat

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
author reimar
date Wed, 30 Sep 2009 13:35:13 +0000
parents 432736854b4c
children c6eeec0f9b40
files mpc8.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpc8.c	Wed Sep 30 09:46:48 2009 +0000
+++ b/mpc8.c	Wed Sep 30 13:35:13 2009 +0000
@@ -250,6 +250,8 @@
     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);