]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_colorconstancy: fix overreads in gauss array
authorPaul B Mahol <onemda@gmail.com>
Sat, 12 Oct 2019 09:07:54 +0000 (11:07 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sat, 12 Oct 2019 17:07:51 +0000 (19:07 +0200)
Fixes #8250

libavfilter/vf_colorconstancy.c

index e3bb39e51ba0807c4766c36b3b81a6ce2fa15e9a..cc081e957f0a6948b68f4db597ba1e4a1c830f2e 100644 (file)
@@ -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]);
                     }
                 }
             }