Browse Source

mpegvideo: fix null pointer dereference on switching streams

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 12 years ago
parent
commit
46c48d546d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      libavcodec/mpegvideo.c

+ 1 - 0
libavcodec/mpegvideo.c

@@ -695,6 +695,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
     s->input_picture_number = s1->input_picture_number;
 
     av_assert0(!s->picture || s->picture != s1->picture);
+    if(s->picture)
     for (i = 0; i < MAX_PICTURE_COUNT; i++) {
         ff_mpeg_unref_picture(s, &s->picture[i]);
         if (s1->picture[i].f.data[0] &&