]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/aiffdec.c
avformat/westwoodaudenc: Adds muxer for Westwood AUD format.
[ffmpeg] / libavformat / aiffdec.c
index 5abc0c9643dbb7e9fb1f58f4c48cc81d19d0d5fd..1b693b71a3368cf6c8a0994af1710af2896fbd2e 100644 (file)
@@ -212,7 +212,7 @@ static int aiff_read_header(AVFormatContext *s)
     AVIOContext *pb = s->pb;
     AVStream * st;
     AIFFInputContext *aiff = s->priv_data;
-    ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+    ID3v2ExtraMeta *id3v2_extra_meta;
 
     /* check FORM header */
     filesize = get_tag(pb, &tag);
@@ -286,6 +286,8 @@ static int aiff_read_header(AVFormatContext *s)
             get_meta(s, "comment"  , size);
             break;
         case MKTAG('S', 'S', 'N', 'D'):     /* Sampled sound chunk */
+            if (size < 8)
+                return AVERROR_INVALIDDATA;
             aiff->data_end = avio_tell(pb) + size;
             offset = avio_rb32(pb);      /* Offset of sound data */
             avio_rb32(pb);               /* BlockSize... don't care */