diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-09-21 14:35:00 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-09-21 14:36:30 +0100 |
commit | e6d7f6987ee385e4fb7253f90d09953167246a3c (patch) | |
tree | 2a43d2a7271525ab973a557f20bd9ea20c368840 /pdf/pdf_func.c | |
parent | ab0ecb7d44cfc2cf90dcb67c4bafc7ebf5bd5a58 (diff) | |
download | ghostpdl-e6d7f6987ee385e4fb7253f90d09953167246a3c.tar.gz |
lgtm fixes: multiplication may overflow.
Promote multplicands before multiplication to avoid overflow
before the result is lengthened.
Diffstat (limited to 'pdf/pdf_func.c')
-rw-r--r-- | pdf/pdf_func.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_func.c b/pdf/pdf_func.c index 45f22a49f..4c41e812e 100644 --- a/pdf/pdf_func.c +++ b/pdf/pdf_func.c @@ -459,7 +459,7 @@ pdfi_build_function_0(pdf_context *ctx, gs_function_params_t * mnDR, for (i=0;i<params.m;i++) { inputs *= params.Size[i]; } - samples = params.n * params.BitsPerSample; + samples = params.n * (uint64_t)params.BitsPerSample; samples *= inputs; samples = samples >> 3; if (samples > Length) { |