]> git.sesse.net Git - vlc/commitdiff
avcodec: check p_pict for NULL before using it
authorIlkka Ollakka <ileoo@videolan.org>
Wed, 26 May 2010 12:40:17 +0000 (15:40 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Wed, 26 May 2010 12:40:17 +0000 (15:40 +0300)
modules/codec/avcodec/encoder.c

index 70eea774208aa7315aa43bf6ba7c4a0badbc7528..a96d26fd23cd66600e02b886d81009b8bcec105d 100644 (file)
@@ -884,7 +884,9 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
         if( !p_sys->p_context->max_b_frames || !p_sys->p_context->delay )
         {
             /* No delay -> output pts == input pts */
-            p_block->i_pts = p_block->i_dts = p_pict->date;
+            if( p_pict )
+                p_block->i_dts = p_pict->date;
+            p_block->i_pts = p_block->i_dts;
         }
         else if( p_sys->p_context->coded_frame->pts != (int64_t)AV_NOPTS_VALUE &&
             p_sys->p_context->coded_frame->pts != 0 &&