Commit f250fde8 authored by Ilkka Ollakka's avatar Ilkka Ollakka

avcodec: check p_pict for NULL before using it

parent 86263dcd
...@@ -884,7 +884,9 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) ...@@ -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 ) if( !p_sys->p_context->max_b_frames || !p_sys->p_context->delay )
{ {
/* No delay -> output pts == input pts */ /* 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 && else if( p_sys->p_context->coded_frame->pts != (int64_t)AV_NOPTS_VALUE &&
p_sys->p_context->coded_frame->pts != 0 && p_sys->p_context->coded_frame->pts != 0 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment