From c71999ef97b7cc8b1cb6eaf39e72e9ecbf825d9e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 11 Jan 2016 17:08:07 +0100 Subject: [PATCH] avformat/dfa: Fix packet leak on error Fixes: 07fa81f300736485e585b63e7b1cd155/signal_sigabrt_7ffff6ae7cb7_16_94ee815791a1357826524072db5bc2dc.dfa Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavformat/dfa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/dfa.c b/libavformat/dfa.c index 40e3fad068..b16672ccde 100644 --- a/libavformat/dfa.c +++ b/libavformat/dfa.c @@ -101,6 +101,7 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt) frame_size = AV_RL32(pkt->data + pkt->size - 8); if (frame_size > INT_MAX - 4) { av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size); + av_packet_unref(pkt); return AVERROR(EIO); } if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) {