mxfdec: fix memleak on read error/EOF.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Fri, 20 Apr 2012 18:57:57 +0000 (20:57 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Fri, 20 Apr 2012 18:58:45 +0000 (20:58 +0200)
This also matches the rest of the demuxer which will return
partial packets.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavformat/mxfdec.c

index da5df94..8da3367 100644 (file)
@@ -2118,8 +2118,8 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
     if ((ret64 = avio_seek(s->pb, pos, SEEK_SET)) < 0)
         return ret64;
 
-        if ((ret = av_get_packet(s->pb, pkt, size)) != size)
-            return ret < 0 ? ret : AVERROR_EOF;
+    if ((size = av_get_packet(s->pb, pkt, size)) < 0)
+        return size;
 
     if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && t->ptses &&
         mxf->current_edit_unit >= 0 && mxf->current_edit_unit < t->nb_ptses) {