Fix memory leak for truncated frames
authorVitor Sessak <vitor1001@gmail.com>
Fri, 19 Feb 2010 20:20:17 +0000 (20:20 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Fri, 19 Feb 2010 20:20:17 +0000 (20:20 +0000)
Originally committed as revision 21901 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/xa.c

index fedc2f2..d9179df 100644 (file)
@@ -106,8 +106,8 @@ static int xa_read_packet(AVFormatContext *s,
     packet_size = 15*st->codec->channels;
 
     ret = av_get_packet(pb, pkt, packet_size);
-    if(ret != packet_size)
-        return AVERROR(EIO);
+    if(ret < 0)
+        return ret;
 
     pkt->stream_index = st->index;
     xa->sent_bytes += packet_size;