diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-25 19:22:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-26 18:35:55 +0100 |
commit | 2779d33ed99898675e0b3884fabe1ce6839f36d1 (patch) | |
tree | bf3e312154125482ed9eb294724d389f90fe2a38 /libavformat/aacdec.c | |
parent | 2b6964f764382742bb052a1ee3b7167cac35332f (diff) | |
download | ffmpeg-2779d33ed99898675e0b3884fabe1ce6839f36d1.tar.gz |
avformat/aacdec: Fix leak in adts_aac_read_packet()
Fixes: chromium-773637/clusterfuzz-testcase-minimized-6418078673141760
Found-by: ossfuzz/chromium
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/aacdec.c')
-rw-r--r-- | libavformat/aacdec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 364b33404f..36d558ff54 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -139,7 +139,11 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR_INVALIDDATA; } - return av_append_packet(s->pb, pkt, fsize - ADTS_HEADER_SIZE); + ret = av_append_packet(s->pb, pkt, fsize - ADTS_HEADER_SIZE); + if (ret < 0) + av_packet_unref(pkt); + + return ret; } AVInputFormat ff_aac_demuxer = { |