diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2013-04-07 09:48:57 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2013-04-07 13:25:24 +0200 |
commit | 0884d04dc329087e287cab345330303f8972f270 (patch) | |
tree | 2e3370a82a28bcdfc478410a1151daa1937994a7 /libavcodec/utils.c | |
parent | 38665efcc71ff7b0de9c012c0c4f2e509907be24 (diff) | |
download | ffmpeg-0884d04dc329087e287cab345330303f8972f270.tar.gz |
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.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 76f7e8e142..e4ea32523d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -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) |