diff options
author | Philip Langdale <philipl@overt.org> | 2012-08-05 08:57:20 -0700 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2012-08-05 09:11:11 -0700 |
commit | 50b4dbf65a8b0fbd0155e1ffc0ed58fa591d3736 (patch) | |
tree | d636e72479e0687b6fafaf66d906cf72ab3ac3f6 /libavcodec | |
parent | c30f53e4d8156f1a1e2b15b3d5504c4a67a88d5f (diff) | |
download | ffmpeg-50b4dbf65a8b0fbd0155e1ffc0ed58fa591d3736.tar.gz |
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 'libavcodec')
-rw-r--r-- | libavcodec/ass_split.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c index a0b72542c7..81d501eefe 100644 --- a/libavcodec/ass_split.c +++ b/libavcodec/ass_split.c @@ -352,8 +352,10 @@ void ff_ass_split_free(ASSSplitContext *ctx) { if (ctx) { int i; - for (i=0; i<FF_ARRAY_ELEMS(ass_sections); i++) + for (i=0; i<FF_ARRAY_ELEMS(ass_sections); i++) { free_section(ctx, &ass_sections[i]); + av_freep(&(ctx->field_order[i])); + } av_free(ctx); } } |