]> git.sesse.net Git - ffmpeg/commitdiff
mov: fix handling of odd sized yv12
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 31 Dec 2012 23:38:01 +0000 (00:38 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 31 Dec 2012 23:44:44 +0000 (00:44 +0100)
Part 1 of 2 to fix Ticket339

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index a7f64940aafd7111b0642e92ed111b1b54f8f5ce..ee862e5ca9c2f64ec011693e8a4ad9289e64d114 100644 (file)
@@ -1298,8 +1298,11 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
             if (len < 31)
                 avio_skip(pb, 31 - len);
             /* codec_tag YV12 triggers an UV swap in rawdec.c */
-            if (!memcmp(st->codec->codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25))
+            if (!memcmp(st->codec->codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)){
                 st->codec->codec_tag=MKTAG('I', '4', '2', '0');
+                st->codec->width &= ~1;
+                st->codec->height &= ~1;
+            }
             /* Flash Media Server uses tag H263 with Sorenson Spark */
             if (format == MKTAG('H','2','6','3') &&
                 !memcmp(st->codec->codec_name, "Sorenson H263", 13))