changeset 622:d4f80b13d981 libavformat

10l (double free)
author michael
date Sun, 19 Dec 2004 20:25:55 +0000
parents d3baee10d526
children 9797489e1700
files img2.c
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/img2.c	Sun Dec 19 02:55:40 2004 +0000
+++ b/img2.c	Sun Dec 19 20:25:55 2004 +0000
@@ -155,7 +155,6 @@
 
     st = av_new_stream(s1, 0);
     if (!st) {
-        av_free(s);
         return -ENOMEM;
     }
 
@@ -181,7 +180,7 @@
     
     if (!s->is_pipe) {
         if (find_image_range(&first_index, &last_index, s->path) < 0)
-            goto fail;
+            return AVERROR_IO;
         s->img_first = first_index;
         s->img_last = last_index;
         s->img_number = first_index;
@@ -204,10 +203,6 @@
     }
 
     return 0;
- 
- fail:
-    av_free(s);
-    return AVERROR_IO;
 }
 
 static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)