changeset 319:6285d395baf4 libavformat

fixed memory leak
author bellard
date Thu, 20 Nov 2003 11:22:25 +0000
parents 54e915169d48
children 4b01f2d7a90c
files utils.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Wed Nov 19 02:34:40 2003 +0000
+++ b/utils.c	Thu Nov 20 11:22:25 2003 +0000
@@ -698,13 +698,11 @@
                     return 0;
                 }
             } else {
+                /* free packet */
+                av_free_packet(&s->cur_pkt); 
                 s->cur_st = NULL;
             }
         } else {
-            /* free previous packet */
-            if (s->cur_st && s->cur_st->parser)
-                av_free_packet(&s->cur_pkt); 
-
             /* read next packet */
             ret = av_read_packet(s, &s->cur_pkt);
             if (ret < 0)