[vlc-commits] commit: avcodec: check p_pict for NULL before using it (Ilkka Ollakka )

git at videolan.org git at videolan.org
Wed May 26 14:56:36 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed May 26 15:40:17 2010 +0300| [f250fde857ed92d04c362e6174d081d0d03ea729] | committer: Ilkka Ollakka 

avcodec: check p_pict for NULL before using it

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f250fde857ed92d04c362e6174d081d0d03ea729
---

 modules/codec/avcodec/encoder.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 70eea77..a96d26f 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -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 &&



More information about the vlc-commits mailing list