Browse Source

lavc: fix recoded subtitles end.

Text subtitles packets are not 0-terminated (and if they are,
it is handled by the recoding process since 0 is a valid
Unicode code point). The terminating 0 would overwrite the
last payload octet.

OTOH, packets must be 0-padded.

Fix a problem reported in trac ticket #2431.
tags/n2.0
Nicolas George 13 years ago
parent
commit
0884d04dc3
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      libavcodec/utils.c
  2. +1
    -1
      tests/ref/fate/sub-charenc

+ 1
- 1
libavcodec/utils.c View File

@@ -2185,7 +2185,7 @@ static int recode_subtitle(AVCodecContext *avctx,
goto end;
}
outpkt->size -= outl;
outpkt->data[outpkt->size - 1] = '\0';
memset(outpkt->data + outpkt->size, 0, outl);

end:
if (cd != (iconv_t)-1)


+ 1
- 1
tests/ref/fate/sub-charenc View File

@@ -1 +1 @@
a39d7e299a8e25b4ffece0f8d64bf19e
9615088d613931b50fd5016c7535b99a

Loading…
Cancel
Save