diff mbox

[FFmpeg-devel] avfilter/vf_gblur: Increase supported pixel count from 31bit to 32bit in filter_postscale()

Message ID 20170121220150.15989-1-michael@niedermayer.cc
State Accepted
Commit 6294247730549064b1c948c423cf12aa6ff8cf03
Headers show

Commit Message

Michael Niedermayer Jan. 21, 2017, 10:01 p.m. UTC
Fixes CID1396252

RFC: Is it preferred to use 64bit ?

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_gblur.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Michael Niedermayer Jan. 27, 2017, 7:50 p.m. UTC | #1
On Sat, Jan 21, 2017 at 11:01:50PM +0100, Michael Niedermayer wrote:
> Fixes CID1396252
> 
> RFC: Is it preferred to use 64bit ?
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_gblur.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

applied

[...]
diff mbox

Patch

diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 27b702998e..f843e3f376 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -152,12 +152,12 @@  static int filter_postscale(AVFilterContext *ctx, void *arg, int jobnr, int nb_j
     ThreadData *td = arg;
     const int height = td->height;
     const int width = td->width;
-    const int64_t numpixels = width * height;
-    const int slice_start = (numpixels *  jobnr   ) / nb_jobs;
-    const int slice_end   = (numpixels * (jobnr+1)) / nb_jobs;
+    const int64_t numpixels = width * (int64_t)height;
+    const unsigned slice_start = (numpixels *  jobnr   ) / nb_jobs;
+    const unsigned slice_end   = (numpixels * (jobnr+1)) / nb_jobs;
     const float postscale = s->postscale * s->postscaleV;
     float *buffer = s->buffer;
-    int i;
+    unsigned i;
 
     for (i = slice_start; i < slice_end; i++)
         buffer[i] *= postscale;