aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2012-08-05 08:57:20 -0700
committerPhilip Langdale <philipl@overt.org>2012-08-05 09:11:11 -0700
commit50b4dbf65a8b0fbd0155e1ffc0ed58fa591d3736 (patch)
treed636e72479e0687b6fafaf66d906cf72ab3ac3f6 /ffmpeg.c
parentc30f53e4d8156f1a1e2b15b3d5504c4a67a88d5f (diff)
downloadandroid_external_ffmpeg-50b4dbf65a8b0fbd0155e1ffc0ed58fa591d3736.tar.gz
android_external_ffmpeg-50b4dbf65a8b0fbd0155e1ffc0ed58fa591d3736.tar.bz2
android_external_ffmpeg-50b4dbf65a8b0fbd0155e1ffc0ed58fa591d3736.zip
ass subtitles: Fix valgrind warnings.
We're now running some of this code through valgrind for the first time, and a few warnings showed up stemming from two problems. 1) The ASS code assumes the subtitle header is null terminated, but it wasn't, and passing the size down doesn't look like fun, so I added a terminator 2) The code wasn't freeing all of its state. Signed-off-by: Philip Langdale <philipl@overt.org>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 6098422375..faeb2f5c3a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3366,7 +3366,8 @@ static int transcode_init(void)
if ((ist = get_input_stream(ost)))
dec = ist->st->codec;
if (dec && dec->subtitle_header) {
- ost->st->codec->subtitle_header = av_malloc(dec->subtitle_header_size);
+ /* ASS code assumes this buffer is null terminated so add extra byte. */
+ ost->st->codec->subtitle_header = av_mallocz(dec->subtitle_header_size + 1);
if (!ost->st->codec->subtitle_header) {
ret = AVERROR(ENOMEM);
goto dump_format;