Maybe fix gcc 2.95
[ffmpeg.git] / libavformat / mpc8.c
index 472d17c..85cbb41 100644 (file)
@@ -90,12 +90,11 @@ static int mpc8_probe(AVProbeData *p)
         if (bs + size - 2 >= bs_end)
             return AVPROBE_SCORE_MAX / 4 - 1; //seems to be valid MPC but no header yet
         if (header_found) {
-
-        if (size < 11 || size > 28)
-            return 0;
-        if (!AV_RL32(bs)) //zero CRC is invalid
-            return 0;
-        return AVPROBE_SCORE_MAX;
+            if (size < 11 || size > 28)
+                return 0;
+            if (!AV_RL32(bs)) //zero CRC is invalid
+                return 0;
+            return AVPROBE_SCORE_MAX;
         } else {
             bs += size - 2;
         }
@@ -251,6 +250,8 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
     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);