Commit c0175fa9 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

idroqdec: fix leaking pkt on failure

The code calls av_new_packet a few lines above and the allocated memory
has to be freed in case of an error.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 94d3d982
......@@ -222,8 +222,10 @@ static int roq_read_packet(AVFormatContext *s,
pkt->pos= avio_tell(pb);
ret = avio_read(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE,
chunk_size);
if (ret != chunk_size)
if (ret != chunk_size) {
av_packet_unref(pkt);
ret = AVERROR(EIO);
}
packet_read = 1;
break;
......
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