changeset 1573:a4aa536938b8 libavcodec

segfault fix
author michael
date Sat, 25 Oct 2003 19:30:14 +0000
parents 860e44e2c20c
children 1396e33a9cb6
files mpegvideo.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Sat Oct 25 15:22:34 2003 +0000
+++ b/mpegvideo.c	Sat Oct 25 19:30:14 2003 +0000
@@ -585,8 +585,10 @@
     av_freep(&s->input_picture);
     av_freep(&s->reordered_input_picture);
 
-    for(i=0; i<MAX_PICTURE_COUNT; i++){
-        free_picture(s, &s->picture[i]);
+    if(s->picture){
+        for(i=0; i<MAX_PICTURE_COUNT; i++){
+            free_picture(s, &s->picture[i]);
+        }
     }
     av_freep(&s->picture);
     avcodec_default_free_buffers(s->avctx);