Browse code

avformat/id3v2: detect PNG by header instead of mime

the mimetype for PNG can be set to jpeg

Fixes 01\ -\ Cider\ Time.mp3

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2015/06/19 01:37:39
Showing 1 changed files
... ...
@@ -1083,6 +1083,9 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
1083 1083
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
1084 1084
         st->codec->codec_id   = apic->id;
1085 1085
 
1086
+        if (AV_RB64(apic->buf->data) == 0x89504e470d0a1a0a)
1087
+            st->codec->codec_id = AV_CODEC_ID_PNG;
1088
+
1086 1089
         if (apic->description[0])
1087 1090
             av_dict_set(&st->metadata, "title", apic->description, 0);
1088 1091