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-18 01:16:43 +0300
commit41359d381a2b5f5057502b2839b5eb42af69804f (patch)
treec25e181ba25fa73fd1b5dd441ace3400922db3a2 /libavformat
parent581cce0cca80e9a999edfa74b0b756856da484f0 (diff)
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>
Diffstat (limited to 'libavformat')
-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);