]> git.sesse.net Git - ffmpeg/commitdiff
avformat/isom: only write the size if its non zero in mov_rewrite_dvd_sub_extradata()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 17 Mar 2014 16:08:39 +0000 (17:08 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 17 Mar 2014 16:09:33 +0000 (17:09 +0100)
Fixes regression with NeroRecodeSample.mp4

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

index d897808391b3eff2e262c5095de9a7facf871743..a38d39701b285626e9e7b9e4dcb70d37187dbd2c 100644 (file)
@@ -464,8 +464,10 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st)
     if (st->codec->extradata_size != 64)
         return 0;
 
-    snprintf(buf, sizeof(buf), "size: %dx%d\npalette: ",
-             st->codec->width, st->codec->height);
+    if (st->codec->width > 0 &&  st->codec->height > 0)
+        snprintf(buf, sizeof(buf), "size: %dx%d\n",
+                 st->codec->width, st->codec->height);
+    av_strlcat(buf, "palette: ", sizeof(buf));
 
     for (i = 0; i < 16; i++) {
         uint32_t yuv = AV_RB32(src + i * 4);