Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-09 01:53:52 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-09 23:10:35 +0300
commit467eece1bea5c8325c6974190ba61f1bba88a3f3 (patch)
tree034cd7c60cba9eedfad8c69fe746b7523476e2d3 /libavformat/icodec.c
parentab6ffc2a08004dd2aa717cb5e6cc1dcabb09485c (diff)
icodec: fix leaking pkt on error
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/icodec.c')
-rw-r--r--libavformat/icodec.c4
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);