changeset 1800:3edc6f0468be libavformat

not checking error return, resulting double free returning uninitalized pointers
author michael
date Sat, 17 Feb 2007 02:46:47 +0000
parents 0dc3a767943d
children 9cd35d039830
files ipmovie.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ipmovie.c	Thu Feb 15 15:39:39 2007 +0000
+++ b/ipmovie.c	Sat Feb 17 02:46:47 2007 +0000
@@ -227,7 +227,7 @@
 
     /* see if there are any pending packets */
     chunk_type = load_ipmovie_packet(s, pb, pkt);
-    if ((chunk_type == CHUNK_VIDEO) && (chunk_type != CHUNK_DONE))
+    if (chunk_type != CHUNK_DONE)
         return chunk_type;
 
     /* read the next chunk, wherever the file happens to be pointing */
@@ -601,8 +601,10 @@
         ret = AVERROR_IO;
     else if (ret == CHUNK_NOMEM)
         ret = AVERROR_NOMEM;
+    else if (ret == CHUNK_VIDEO)
+        ret = 0;
     else
-        ret = 0;
+        ret = -1;
 
     return ret;
 }