[FFmpeg-cvslog] pthreads: fix segfault due to the thread beimg killed before it has been allocated

avcoder ffmpeg at gmail.com
Sun Nov 27 04:56:58 CET 2011


Hi, this commit breaks MinGW because 'p->thread' is defined as a struct.

On Sun, Nov 27, 2011 at 1:43 AM, Michael Niedermayer <git at videolan.org> wrote:
> ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 26 17:55:01 2011 +0100| [61c2cec9579b5a24e95102b137eab3ecc6902d15] | committer: Michael Niedermayer
>
> pthreads: fix segfault due to the thread beimg killed before it has been allocated
>
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=61c2cec9579b5a24e95102b137eab3ecc6902d15
> ---
>
>  libavcodec/pthread.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
> index eb30472..e3815ba 100644
> --- a/libavcodec/pthread.c
> +++ b/libavcodec/pthread.c
> @@ -658,7 +658,8 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count)
>         pthread_cond_signal(&p->input_cond);
>         pthread_mutex_unlock(&p->mutex);
>
> -        pthread_join(p->thread, NULL);
> +        if(p->thread)
> +            pthread_join(p->thread, NULL);
>
>         if (codec->close)
>             codec->close(p->avctx);
>

-- 
-----------------------------------------------------------------------------------------
My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2


More information about the ffmpeg-cvslog mailing list