]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpc8.c
Add a space between the else and { in mpegenc.c in the line i added.
[ffmpeg] / libavformat / mpc8.c
index 472d17cc5d61ff58575ed425917300c0f9d1f9c1..92e996c29c23736c854e7e9c127f89f150457b57 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;
         }
@@ -225,7 +224,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
     st = av_new_stream(s, 0);
     if (!st)
         return AVERROR(ENOMEM);
-    st->codec->codec_type = CODEC_TYPE_AUDIO;
+    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_MUSEPACK8;
     st->codec->bits_per_coded_sample = 16;
 
@@ -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);