aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-08 23:53:52 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-27 00:38:56 +0100
commitc3307f7e9e1889c15dcaad1247c8212628474bc5 (patch)
tree588c19c2c413b0ab6ca577e4e397684ca23721cf
parent3d82cebdd2bd5424b0eb37b0e39284da19fa0e5b (diff)
downloadffmpeg-c3307f7e9e1889c15dcaad1247c8212628474bc5.tar.gz
icodec: fix leaking pkt on error
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 467eece1bea5c8325c6974190ba61f1bba88a3f3) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/icodec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index 6ddb901b7e..e866cf91d5 100644
--- a/libavformat/icodec.c
+++ b/libavformat/icodec.c
@@ -170,8 +170,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->codec->bits_per_coded_sample = AV_RL16(buf + 14);