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:
authorPaul B Mahol <onemda@gmail.com>2019-10-11 13:42:13 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 19:40:16 +0300
commitc1ce4fba515628096efb93247f5f24a62a91ba64 (patch)
tree3740aa521111884626720482f36fcdafbe2e42b6 /libavfilter
parentc72ed4f3ebffbd5ed9713caf694dc8687a35d1c0 (diff)
avfilter/vf_bitplanenoise: fix overreads
Fixes #8244 (cherry picked from commit 0b567238741854b41f84f7457686b044eadfe29c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_bitplanenoise.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_bitplanenoise.c b/libavfilter/vf_bitplanenoise.c
index dd6864bc5e..55a3ff80ae 100644
--- a/libavfilter/vf_bitplanenoise.c
+++ b/libavfilter/vf_bitplanenoise.c
@@ -122,7 +122,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (s->depth <= 8) {
for (plane = 0; plane < s->nb_planes; plane++) {
- const int linesize = in->linesize[plane];
+ const int linesize = s->planeheight[plane] > 1 ? in->linesize[plane] : 0;
const int dlinesize = out->linesize[plane];
uint8_t *val = in->data[plane];
uint8_t *dst = s->filter ? out->data[plane]: NULL;
@@ -151,7 +151,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
} else {
for (plane = 0; plane < s->nb_planes; plane++) {
- const int linesize = in->linesize[plane] / 2;
+ const int linesize = s->planeheight[plane] > 1 ? in->linesize[plane] / 2 : 0;
const int dlinesize = out->linesize[plane] / 2;
uint16_t *val = (uint16_t *)in->data[plane];
uint16_t *dst = s->filter ? (uint16_t *)out->data[plane] : NULL;