Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-11-11 14:59:44 +0300
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-11 16:19:05 +0300
commit8dd73f68a6319d1784b33da9553671f1a0c197f9 (patch)
tree75f34af9a62c0b20780838d7a3f9720d2111aa87 /libavcodec/decode.c
parent6a4d1c9063174234ca439244cf8f5f534afa1c28 (diff)
avcodec/decode: always free private_ref
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.
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c6
1 files 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;
}