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 <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-01-11 17:08:07 +01:00
parent 71f73ee325
commit c71999ef97
1 changed files with 1 additions and 0 deletions

View File

@ -101,6 +101,7 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt)
frame_size = AV_RL32(pkt->data + pkt->size - 8); frame_size = AV_RL32(pkt->data + pkt->size - 8);
if (frame_size > INT_MAX - 4) { if (frame_size > INT_MAX - 4) {
av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size); av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size);
av_packet_unref(pkt);
return AVERROR(EIO); return AVERROR(EIO);
} }
if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) { if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) {