[FFmpeg-devel] [PATCH] Manage the case when the avctx provided to avcodec_close() is NULL.

Michael Niedermayer michaelni
Mon Dec 6 02:35:15 CET 2010


On Sat, Dec 04, 2010 at 07:38:47PM +0100, Stefano Sabatini wrote:
> ---
>  libavcodec/utils.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 69d333e..4269a53 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -726,6 +726,8 @@ void avsubtitle_free(AVSubtitle *sub)
>  
>  av_cold int avcodec_close(AVCodecContext *avctx)
>  {
> +    if (!avctx)
> +        return 0;
>      /* If there is a user-supplied mutex locking routine, call it. */
>      if (ff_lockmgr_cb) {
>          if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))

lgtm

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101206/d01e9fd3/attachment.pgp>



More information about the ffmpeg-devel mailing list