]> git.sesse.net Git - vlc/commitdiff
codec/schroedinger: fix segfault when schro_decoder_pull returns NULL
authorDavid Flynn <davidf@rd.bbc.co.uk>
Thu, 7 May 2009 12:47:36 +0000 (12:47 +0000)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 7 May 2009 15:36:30 +0000 (18:36 +0300)
Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
modules/codec/schroedinger.c

index cf81333fa3e3e3f960751f5db7d3b361c16bc634..d38028057480be2cca1948999da102277f0c596f 100644 (file)
@@ -358,12 +358,12 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         case SCHRO_DECODER_OK: {
             SchroTag *p_tag = schro_decoder_get_picture_tag( p_sys->p_schro );
             p_schroframe = schro_decoder_pull( p_sys->p_schro );
-            if( !p_schroframe->priv )
+            if( !p_schroframe || !p_schroframe->priv )
             {
                 /* frame can't be one that was allocated by us
                  *   -- no private data: discard */
                 if( p_tag ) schro_tag_free( p_tag );
-                schro_frame_unref( p_schroframe );
+                if( p_schroframe ) schro_frame_unref( p_schroframe );
                 break;
             }
             p_pic = ((struct picture_free_t*) p_schroframe->priv)->p_pic;