diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2022-10-21 18:25:08 +0800 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2022-11-21 23:52:18 +0800 |
commit | d4b06c99abf3e147f7b1ce7160d31d2dcc525eda (patch) | |
tree | 1a45f818da90bc1e3adce7f8d8937e0961a5bd15 /libavcodec/mediacodecdec_common.c | |
parent | 2b97fdb8cc9112babc5cb939f62620efab7bba5c (diff) |
avcodec/mediacodecdec_common: fix useless av_buffer_unref
Since frame->buf[0] is always NULL in this case, av_buffer_unref
has no effect. If it's not NULL, double-free will happen.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavcodec/mediacodecdec_common.c')
-rw-r--r-- | libavcodec/mediacodecdec_common.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c index 4c48b9142e..69a462ec48 100644 --- a/libavcodec/mediacodecdec_common.c +++ b/libavcodec/mediacodecdec_common.c @@ -335,7 +335,6 @@ static int mediacodec_wrap_hw_buffer(AVCodecContext *avctx, return 0; fail: av_freep(&buffer); - av_buffer_unref(&frame->buf[0]); status = ff_AMediaCodec_releaseOutputBuffer(s->codec, index, 0); if (status < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to release output buffer\n"); |