From 2c993fece28b41b68435e86ceb5daf53b7b78197 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 19 Mar 2013 14:19:29 +0100 Subject: [PATCH] audio_get_buffer: add assert to ensure nb_extended_buf has a safe value May silence CID991853 Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b03113201f..b245914331 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -478,8 +478,10 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame) av_freep(&frame->extended_buf); return AVERROR(ENOMEM); } - } else + } else { frame->extended_data = frame->data; + av_assert0(frame->nb_extended_buf == 0); + } for (i = 0; i < FFMIN(planes, AV_NUM_DATA_POINTERS); i++) { frame->buf[i] = av_buffer_pool_get(pool->pools[0]);