aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-11 12:23:26 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-11 12:23:26 +0200
commitb62f7e243cf4a1863ee4131e55536338eacecc6c (patch)
tree6a074365272cab13513bc12333b134e56fae3310 /libavfilter
parent7ad69a73f3d9d0e4575ef40e746a974989b3d3eb (diff)
downloadffmpeg-b62f7e243cf4a1863ee4131e55536338eacecc6c.tar.gz
avfilter/vf_deflicker: fix invalid access
Fixes #8253
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_deflicker.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/vf_deflicker.c b/libavfilter/vf_deflicker.c
index b038b977f6..ea3f430a05 100644
--- a/libavfilter/vf_deflicker.c
+++ b/libavfilter/vf_deflicker.c
@@ -420,7 +420,10 @@ static int request_frame(AVFilterLink *outlink)
ret = ff_request_frame(ctx->inputs[0]);
if (ret == AVERROR_EOF && s->available > 0) {
- AVFrame *buf = av_frame_clone(ff_bufqueue_peek(&s->q, s->size - 1));
+ AVFrame *buf = ff_bufqueue_peek(&s->q, s->available - 1);
+ if (!buf)
+ return AVERROR(ENOMEM);
+ buf = av_frame_clone(buf);
if (!buf)
return AVERROR(ENOMEM);