forked from FFmpeg/FFmpeg
yuv4mpegdec: fix leaking pkt in yuv4_read_packet
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
acdd2d805d
commit
e3694478a9
1 changed files with 3 additions and 2 deletions
|
@ -295,9 +295,10 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
ret = av_get_packet(s->pb, pkt, s->packet_size - Y4M_FRAME_MAGIC_LEN);
|
ret = av_get_packet(s->pb, pkt, s->packet_size - Y4M_FRAME_MAGIC_LEN);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
else if (ret != s->packet_size - Y4M_FRAME_MAGIC_LEN)
|
else if (ret != s->packet_size - Y4M_FRAME_MAGIC_LEN) {
|
||||||
|
av_packet_unref(pkt);
|
||||||
return s->pb->eof_reached ? AVERROR_EOF : AVERROR(EIO);
|
return s->pb->eof_reached ? AVERROR_EOF : AVERROR(EIO);
|
||||||
|
}
|
||||||
pkt->stream_index = 0;
|
pkt->stream_index = 0;
|
||||||
pkt->pts = (off - s->internal->data_offset) / s->packet_size;
|
pkt->pts = (off - s->internal->data_offset) / s->packet_size;
|
||||||
pkt->duration = 1;
|
pkt->duration = 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue