diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-11 12:23:26 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-10-11 12:23:26 +0200 |
commit | b62f7e243cf4a1863ee4131e55536338eacecc6c (patch) | |
tree | 6a074365272cab13513bc12333b134e56fae3310 | |
parent | 7ad69a73f3d9d0e4575ef40e746a974989b3d3eb (diff) | |
download | ffmpeg-b62f7e243cf4a1863ee4131e55536338eacecc6c.tar.gz |
avfilter/vf_deflicker: fix invalid access
Fixes #8253
-rw-r--r-- | libavfilter/vf_deflicker.c | 5 |
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); |