mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-18 13:00:00 +01:00
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.
This commit is contained in:
@@ -535,6 +535,7 @@ 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;
|
||||||
|
if (priv->avctx.release_buffer)
|
||||||
priv->avctx.release_buffer(&priv->avctx, &priv->frame);
|
priv->avctx.release_buffer(&priv->avctx, &priv->frame);
|
||||||
av_freep(&priv);
|
av_freep(&priv);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user