[Libav-user] av_buffersink_get_frame() crashes

Nicolas George nicolas.george at normalesup.org
Fri May 3 12:36:21 CEST 2013

Le tridi 13 floréal, an CCXXI, Radu Robotin a écrit :
> I'm using ffmpeg with libavcodec and libavfilters for a custom project.
> I've recently upgraded to the latest version available from git and noticed
> that my previous code has stopped working. I'm processing several streams,
> each in his own thread in the following way:
>      next sample is taken from the stream, decoded and then inserted in the
> buffer source of the filtergraph using av_buffersrc_add_frame()
>      a frame is extracted from the buffer sink of the filtergraph using
> av_buffersink_get_frame()
>     the filtered frame is  copied in a buffer for further processing
> before upgrading to the latest version of ffmpeg I've been using ffmpeg 1.2
> and everything worked flawlessly.  The filtered buffer was pulled from the
> filtergraph using the av_buffersink_get_buffer_ref().

The change from buffer ref to frames was accompanied with a change in the
lifetime of the frames. What you describe looks like a problem with that,
but without seeing the code it is impossible to tell for sure.

> The problem I'm encountering: at the first pass everything works fine,
> however when I call the processing function for the second time (for
> processing the next frame), it coredumps when I call
> av_buffersink_get_frame() with the message " corrupted double-linked list ".
> I tried further investigating the problem and have several
> frames processed during the same call of this function: everything works
> until the second call, then it coredumps at the same point.

The "corrupted double-linked list" message seems to indicate corrupted
memory: either you write to an invalid location, or you write to a location
that was previously freed, but you do not get the error immediately. I
suggest you use valgrind to get an error at the exact time of the problem.

> To me it seems that something changes the structure of the filtergraph
> between the calls to the processing function.

I am rather sure that the structure of the filter graph is not supposed to
change after it has been configured.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130503/e7913069/attachment.asc>

More information about the Libav-user mailing list