diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-04-09 14:16:22 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-04-09 14:16:22 +0000 |
commit | ef12ec23fa03e520bffef34ec2eba2ac0572fb27 (patch) | |
tree | 790e950d8f1801a96f38220277c298d12e7b4c18 /libavformat | |
parent | 7a709548a7f30559826aa30be185f8ce9d3a02b6 (diff) | |
download | ffmpeg-ef12ec23fa03e520bffef34ec2eba2ac0572fb27.tar.gz |
Fix memleak in nuv demuxer: free packet already allocated packet when
returning an error in nuv_packet.
Originally committed as revision 18385 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/nuv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c index a6e8e013fc..2f055b5f0f 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -226,7 +226,10 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { pkt->stream_index = ctx->v_id; memcpy(pkt->data, hdr, copyhdrsize); ret = get_buffer(pb, pkt->data + copyhdrsize, size); - if (ret < 0) return ret; + if (ret < 0) { + av_free_packet(pkt); + return ret; + } if (ret < size) av_shrink_packet(pkt, copyhdrsize + ret); return 0; |