diff idcin.c @ 5685:e8614dbd9b7b libavformat

Fix memory leak for truncated packets in idCin demuxer
author vitor
date Sun, 21 Feb 2010 14:41:39 +0000
parents 36225b62e091
children 536e5527c1e0
line wrap: on
line diff
--- a/idcin.c	Sat Feb 20 22:57:23 2010 +0000
+++ b/idcin.c	Sun Feb 21 14:41:39 2010 +0000
@@ -260,8 +260,8 @@
         url_fseek(pb, 4, SEEK_CUR);
         chunk_size -= 4;
         ret= av_get_packet(pb, pkt, chunk_size);
-        if (ret != chunk_size)
-            return AVERROR(EIO);
+        if (ret < 0)
+            return ret;
         pkt->stream_index = idcin->video_stream_index;
         pkt->pts = idcin->pts;
     } else {
@@ -271,8 +271,8 @@
         else
             chunk_size = idcin->audio_chunk_size1;
         ret= av_get_packet(pb, pkt, chunk_size);
-        if (ret != chunk_size)
-            return AVERROR(EIO);
+        if (ret < 0)
+            return ret;
         pkt->stream_index = idcin->audio_stream_index;
         pkt->pts = idcin->pts;