aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-05 22:56:36 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-08 00:26:41 +0100
commite3694478a98bc2cd702b3b3f0bfb19a100da737e (patch)
treefc8f463aa564946410c38508655739b042813b48
parentacdd2d805d239cf8b6c1749350f0a2213150986f (diff)
downloadffmpeg-e3694478a98bc2cd702b3b3f0bfb19a100da737e.tar.gz
yuv4mpegdec: fix leaking pkt in yuv4_read_packet
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/yuv4mpegdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c
index a91645f6d6..462b823860 100644
--- a/libavformat/yuv4mpegdec.c
+++ b/libavformat/yuv4mpegdec.c
@@ -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;