mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
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: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
94d3d98246
commit
c0175fa92b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user