Commit e3694478 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

yuv4mpegdec: fix leaking pkt in yuv4_read_packet

Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent acdd2d80
......@@ -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);
if (ret < 0)
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);
}
pkt->stream_index = 0;
pkt->pts = (off - s->internal->data_offset) / s->packet_size;
pkt->duration = 1;
......
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