diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-24 03:23:37 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-26 03:03:59 +0100 |
commit | 3ec3370deac4d21538ef03d8547a12f3acb7bfa8 (patch) | |
tree | a1935c0d4c3c85608707d2b95ca96d0e9b758d32 /libavformat/aadec.c | |
parent | 4f11685e4c882c0dad3c946c6314def140de3205 (diff) | |
download | ffmpeg-3ec3370deac4d21538ef03d8547a12f3acb7bfa8.tar.gz |
avformat/aadec: Fix leak on error
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/aadec.c')
-rw-r--r-- | libavformat/aadec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/aadec.c b/libavformat/aadec.c index 80ca2c12d7..2575e98153 100644 --- a/libavformat/aadec.c +++ b/libavformat/aadec.c @@ -229,8 +229,11 @@ static int aa_read_header(AVFormatContext *s) chapter_pos -= start + CHAPTER_HEADER_SIZE * chapter_idx; avio_skip(pb, 4 + chapter_size); if (!avpriv_new_chapter(s, chapter_idx, st->time_base, - chapter_pos * TIMEPREC, (chapter_pos + chapter_size) * TIMEPREC, NULL)) - return AVERROR(ENOMEM); + chapter_pos * TIMEPREC, + (chapter_pos + chapter_size) * TIMEPREC, NULL)) { + av_freep(&c->tea_ctx); + return AVERROR(ENOMEM); + } } st->duration = (largest_size - CHAPTER_HEADER_SIZE * s->nb_chapters) * TIMEPREC; |