[FFmpeg-devel] [PATCH][RFC] avcodec/pthread_frame: fix null pointer dereference

Nicolas George george at nsup.org
Sat Oct 24 15:15:00 CEST 2015


Le tridi 3 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit :
> Fixes CID 1322329.
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavcodec/pthread_frame.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index 7651211..ca06e3d 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -305,7 +305,7 @@ static void release_delayed_buffers(PerThreadContext *p)
>          pthread_mutex_lock(&fctx->buffer_mutex);
>  
>          // fix extended data in case the caller screwed it up
> -        av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO ||

> +        av_assert0(p->avctx && p->avctx->codec_type == AVMEDIA_TYPE_VIDEO ||

I think the commit message should explain in what circumstances p->avctx can
be NULL. Otherwise, the extra test is only hiding a problem earlier in the
code.

>                     p->avctx->codec_type == AVMEDIA_TYPE_AUDIO);
>          f = &p->released_buffers[--p->num_released_buffers];
>          f->extended_data = f->data;

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151024/d02d945d/attachment.sig>


More information about the ffmpeg-devel mailing list