[FFmpeg-devel] [PATCH] fix crash in ffplay.c #1

Michael Niedermayer michaelni
Tue Dec 30 01:52:06 CET 2008

On Mon, Dec 29, 2008 at 06:25:01PM -0500, Ronald S. Bultje wrote:
> Hi,
> when pressing 'q' to exit ffplay, I occasionally get crashes. I've

and gdb output ?

> tracked it down to a race condition (I think). After 'q', the audio
> objects are discarded and ffplay.c sets

what audio object?

> VideoState->audioq->abort_request. When set, audio_decode_frame(),
> which is called from within the sdl_audio_callback() callback, returns
> -1. However, sdl_audio_callback() then writes silence in the
> (no-longer-existing) audio buffer.

what buffer?
is->audio_buf should still be existing, its just pointing to part of is
stream is an argument from the callback and id consider it very strange
if a argument given to a function becomes invalid at random.

> I think it should just quit, see
> attached patch. With the attached patch, I no longer get such
> segfaults on exit.

so and how is this going to work if we happen to be just after the if()
or even in the memcpy/memset accessing the buffer ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081230/b055fffb/attachment.pgp>

More information about the ffmpeg-devel mailing list