avformat/isom: only write the size if its non zero in mov_rewrite_dvd_sub_extradata()

Fixes regression with NeroRecodeSample.mp4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-03-17 17:08:39 +01:00
parent f6f3c85c0e
commit b6ad5893ce
1 changed files with 4 additions and 2 deletions

View 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);