Commit 64a80588 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_gblur: fix heap-buffer overflow

Fixes #8282
parent e14f5fd0
...@@ -236,7 +236,7 @@ static int config_input(AVFilterLink *inlink) ...@@ -236,7 +236,7 @@ static int config_input(AVFilterLink *inlink)
s->nb_planes = av_pix_fmt_count_planes(inlink->format); s->nb_planes = av_pix_fmt_count_planes(inlink->format);
s->buffer = av_malloc_array(inlink->w, inlink->h * sizeof(*s->buffer)); s->buffer = av_malloc_array(FFALIGN(inlink->w, 16), FFALIGN(inlink->h, 16) * sizeof(*s->buffer));
if (!s->buffer) if (!s->buffer)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
...@@ -100,7 +100,7 @@ cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, nu, bscale, x, y, step, ...@@ -100,7 +100,7 @@ cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, nu, bscale, x, y, step,
add widthq, remainq add widthq, remainq
cmp xq, widthq cmp xq, widthq
je .end_scalar jge .end_scalar
.loop_scalar: .loop_scalar:
; ptr[x] += nu * ptr[x-1] ; ptr[x] += nu * ptr[x-1]
...@@ -148,7 +148,7 @@ cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, nu, bscale, x, y, step, ...@@ -148,7 +148,7 @@ cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, nu, bscale, x, y, step,
jg .loop_x_back jg .loop_x_back
cmp xq, 0 cmp xq, 0
je .end_scalar_back jle .end_scalar_back
.loop_scalar_back: .loop_scalar_back:
; ptr[x-1] += nu * ptr[x] ; ptr[x-1] += nu * ptr[x]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment