[FFmpeg-devel] [PATCH 1/2] avcodec/decode: always free private_ref
Timo Rothenpieler
timo at rothenpieler.org
Sat Nov 11 14:16:05 EET 2017
There is no reason to keep this intact when decoding failed, specially
as private_ref is supposed to always be NULL when a frame is returned to
the user.
---
libavcodec/decode.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 570799f6d7..7601d16082 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -613,7 +613,6 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
if (ret == AVERROR_EOF)
avci->draining_done = 1;
- /* free the per-frame decode data */
if (!ret) {
/* the only case where decode data is not set should be decoders
* that do not call ff_get_buffer() */
@@ -631,10 +630,11 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
}
}
}
-
- av_buffer_unref(&frame->private_ref);
}
+ /* free the per-frame decode data */
+ av_buffer_unref(&frame->private_ref);
+
return ret;
}
--
2.14.2
More information about the ffmpeg-devel
mailing list