pp: avoid overflow in w*h
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 19:09:42 +0000 (21:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 19:17:43 +0000 (21:17 +0200)
Fixes CID700580
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libpostproc/postprocess_template.c

index e1a3977..e97c916 100644 (file)
@@ -3225,7 +3225,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
 
         c.frameNum++;
         // first frame is fscked so we ignore it
-        if(c.frameNum == 1) yHistogram[0]= width*height/64*15/256;
+        if(c.frameNum == 1) yHistogram[0]= width*(uint64_t)height/64*15/256;
 
         for(i=0; i<256; i++){
             sum+= yHistogram[i];