Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-06 00:56:36 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-08 02:26:41 +0300
commite3694478a98bc2cd702b3b3f0bfb19a100da737e (patch)
treefc8f463aa564946410c38508655739b042813b48 /libavformat/yuv4mpegdec.c
parentacdd2d805d239cf8b6c1749350f0a2213150986f (diff)
yuv4mpegdec: fix leaking pkt in yuv4_read_packet
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/yuv4mpegdec.c')
-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;