[FFmpeg-devel] [PATCH] zerocodec: fix direct rendering.

Derek Buitenhuis derek.buitenhuis at gmail.com
Sat Jul 21 18:54:26 CEST 2012

On 21/07/2012 7:24 AM, Reimar Döffinger wrote:
> Set picture type before calling get_buffer.
> This allows the DR application to make better decisions.
> It also fixes a resource leak in case of missing reference frames
> since it would call get_buffer but never release_buffer.
> Also use FFSWAP to ensure that the AVFrame is properly initialized
> in the next get_buffer (in particular that data[0] is NULL).
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libavcodec/zerocodec.c |   34 +++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)

This looks OK, but there is still a memleak if decode_frame fails.
I've actually got a patch for that locally, and I'll rebase/send
once this is pushed.

- Derek

More information about the ffmpeg-devel mailing list