diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-08 23:53:52 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-09 21:10:35 +0100 |
commit | 467eece1bea5c8325c6974190ba61f1bba88a3f3 (patch) | |
tree | 034cd7c60cba9eedfad8c69fe746b7523476e2d3 | |
parent | ab6ffc2a08004dd2aa717cb5e6cc1dcabb09485c (diff) | |
download | ffmpeg-467eece1bea5c8325c6974190ba61f1bba88a3f3.tar.gz |
icodec: fix leaking pkt on error
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavformat/icodec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/icodec.c b/libavformat/icodec.c index 8019a35f44..fa985fb313 100644 --- a/libavformat/icodec.c +++ b/libavformat/icodec.c @@ -174,8 +174,10 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) bytestream_put_le16(&buf, 0); bytestream_put_le32(&buf, 0); - if ((ret = avio_read(pb, buf, image->size)) < 0) + if ((ret = avio_read(pb, buf, image->size)) < 0) { + av_packet_unref(pkt); return ret; + } st->codecpar->bits_per_coded_sample = AV_RL16(buf + 14); |