]> git.sesse.net Git - vlc/commitdiff
Fixed a potential infinite loop with libmpeg2.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 7 Sep 2008 21:14:43 +0000 (23:14 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 7 Sep 2008 21:14:43 +0000 (23:14 +0200)
modules/codec/libmpeg2.c

index f0e3833055b7be60967eef50c9e8d05d7822fbdf..149ae58f8c56061d4fa10e53e2fbd0702e519735 100644 (file)
@@ -235,7 +235,10 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                     uint8_t *buf[3];
                     buf[0] = buf[1] = buf[2] = NULL;
                     if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
+                    {
+                        p_block->i_buffer = 0;
                         break;
+                    }
                     mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic );
                     mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
                 }