diff mbox

[FFmpeg-devel] avfilter/vf_colorconstancy: fix overreads in gauss array

Message ID 20191012090913.20632-1-onemda@gmail.com
State Accepted
Commit a7fd1279703683ebb548ef7baa2f1519994496ae
Headers show

Commit Message

Paul B Mahol Oct. 12, 2019, 9:09 a.m. UTC
Fixes #8250

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/vf_colorconstancy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mina Oct. 12, 2019, 4:34 p.m. UTC | #1
On 10/12/19 11:09 AM, Paul B Mahol wrote:
> Fixes #8250
>
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>   libavfilter/vf_colorconstancy.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/vf_colorconstancy.c b/libavfilter/vf_colorconstancy.c
> index e3bb39e51b..cc081e957f 100644
> --- a/libavfilter/vf_colorconstancy.c
> +++ b/libavfilter/vf_colorconstancy.c
> @@ -280,7 +280,7 @@ static int slice_get_derivative(AVFilterContext* ctx, void* arg, int jobnr, int
>                       dst[INDX2D(r, c, width)] = 0;
>                       for (g = 0; g < filtersize; ++g) {
>                           dst[INDX2D(r, c, width)] += GAUSS(src, r,                        c + GINDX(filtersize, g),
> -                                                          in_linesize, height, width, gauss[GINDX(filtersize, g)]);
> +                                                          in_linesize, height, width, gauss[g]);
>                       }
>                   }
>               }
> @@ -295,7 +295,7 @@ static int slice_get_derivative(AVFilterContext* ctx, void* arg, int jobnr, int
>                       dst[INDX2D(r, c, width)] = 0;
>                       for (g = 0; g < filtersize; ++g) {
>                           dst[INDX2D(r, c, width)] += GAUSS(src, r + GINDX(filtersize, g), c,
> -                                                          width, height, width, gauss[GINDX(filtersize, g)]);
> +                                                          width, height, width, gauss[g]);
>                       }
>                   }
>               }


LGTM

Thanks,
Mina
diff mbox

Patch

diff --git a/libavfilter/vf_colorconstancy.c b/libavfilter/vf_colorconstancy.c
index e3bb39e51b..cc081e957f 100644
--- a/libavfilter/vf_colorconstancy.c
+++ b/libavfilter/vf_colorconstancy.c
@@ -280,7 +280,7 @@  static int slice_get_derivative(AVFilterContext* ctx, void* arg, int jobnr, int
                     dst[INDX2D(r, c, width)] = 0;
                     for (g = 0; g < filtersize; ++g) {
                         dst[INDX2D(r, c, width)] += GAUSS(src, r,                        c + GINDX(filtersize, g),
-                                                          in_linesize, height, width, gauss[GINDX(filtersize, g)]);
+                                                          in_linesize, height, width, gauss[g]);
                     }
                 }
             }
@@ -295,7 +295,7 @@  static int slice_get_derivative(AVFilterContext* ctx, void* arg, int jobnr, int
                     dst[INDX2D(r, c, width)] = 0;
                     for (g = 0; g < filtersize; ++g) {
                         dst[INDX2D(r, c, width)] += GAUSS(src, r + GINDX(filtersize, g), c,
-                                                          width, height, width, gauss[GINDX(filtersize, g)]);
+                                                          width, height, width, gauss[g]);
                     }
                 }
             }