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>
pull/272/head
Michael Niedermayer 7 years ago
parent 2b6964f764
commit 2779d33ed9
  1. 6
      libavformat/aacdec.c

@ -139,7 +139,11 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_INVALIDDATA; 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 = { AVInputFormat ff_aac_demuxer = {

Loading…
Cancel
Save