mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
2b97fdb8cc
commit
d4b06c99ab
|
@ -335,7 +335,6 @@ static int mediacodec_wrap_hw_buffer(AVCodecContext *avctx,
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
av_freep(&buffer);
|
av_freep(&buffer);
|
||||||
av_buffer_unref(&frame->buf[0]);
|
|
||||||
status = ff_AMediaCodec_releaseOutputBuffer(s->codec, index, 0);
|
status = ff_AMediaCodec_releaseOutputBuffer(s->codec, index, 0);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to release output buffer\n");
|
av_log(avctx, AV_LOG_ERROR, "Failed to release output buffer\n");
|
||||||
|
|
Loading…
Reference in New Issue