Commit a2816230 authored by Janne Grunau's avatar Janne Grunau

avframe: call release_buffer only if it is set

AVCodecContext release_buffer() shall be NULL for audio codecs using
get_buffer. The backward compatibility code hence have to check before
calling it.
parent fce68c93
...@@ -535,7 +535,8 @@ typedef struct CompatReleaseBufPriv { ...@@ -535,7 +535,8 @@ typedef struct CompatReleaseBufPriv {
static void compat_free_buffer(void *opaque, uint8_t *data) static void compat_free_buffer(void *opaque, uint8_t *data)
{ {
CompatReleaseBufPriv *priv = opaque; CompatReleaseBufPriv *priv = opaque;
priv->avctx.release_buffer(&priv->avctx, &priv->frame); if (priv->avctx.release_buffer)
priv->avctx.release_buffer(&priv->avctx, &priv->frame);
av_freep(&priv); av_freep(&priv);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment