id3v2: Match PIC mimetype/format case-insensitively
authorMohammad Alsaleh <msal@tormail.org>
Fri, 10 Aug 2012 22:50:25 +0000 (01:50 +0300)
committerAnton Khirnov <anton@khirnov.net>
Sun, 12 Aug 2012 09:00:19 +0000 (11:00 +0200)
Some files' embedded art seems to have the mimetype 'image/JPG' instead
of 'image/jpg'. Libav fails to parse those because it matches
case-sensitively.

Use av_strncasecmp() to fix this behaviour.

Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/id3v2.c

index 650dd59..e12e930 100644 (file)
@@ -450,7 +450,7 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag
     /* mimetype */
     taglen -= avio_get_str(pb, taglen, mimetype, sizeof(mimetype));
     while (mime->id != AV_CODEC_ID_NONE) {
-        if (!strncmp(mime->str, mimetype, sizeof(mimetype))) {
+        if (!av_strncasecmp(mime->str, mimetype, sizeof(mimetype))) {
             id = mime->id;
             break;
         }