Commit 467eece1 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

icodec: fix leaking pkt on error

Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent ab6ffc2a
...@@ -174,8 +174,10 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -174,8 +174,10 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
bytestream_put_le16(&buf, 0); bytestream_put_le16(&buf, 0);
bytestream_put_le32(&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; return ret;
}
st->codecpar->bits_per_coded_sample = AV_RL16(buf + 14); st->codecpar->bits_per_coded_sample = AV_RL16(buf + 14);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment