Browse code

bb#2031

aCaB authored on 2010/05/19 19:20:20
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed May 19 12:19:27 CEST 2010 (acab)
2
+------------------------------------
3
+ * libclamav/pe_icons.c: properly round down when scaling (bb#2031)
4
+
1 5
 Wed May 19 13:15:06 EEST 2010 (edwin)
2 6
 -------------------------------------
3 7
  * libclamav/pdf.c: bb #2016
... ...
@@ -1414,10 +1414,9 @@ static int parseicon(icon_groupset *set, uint32_t rva, cli_ctx *ctx, struct cli_
1414 1414
 	    if(!(newdata = cli_malloc(newsize * newsize * sizeof(*newdata)))) {
1415 1415
 		return CL_SUCCESS;
1416 1416
 	    }
1417
-	    memset(newdata, 0xaaccaabb, newsize * newsize * sizeof(*newdata));
1418 1417
 	    cli_dbgmsg("parseicon: Slow scaling to %ux%u (%f, %f)\n", newsize, newsize, scalex, scaley);
1419 1418
 	    for(y = 0; y<newsize; y++) {
1420
-		unsigned int oldy = (unsigned int)((y * scaley) * width + 0.5f);
1419
+		unsigned int oldy = (unsigned int)(y * scaley) * width;
1421 1420
 		for(x = 0; x<newsize; x++)
1422 1421
 		    newdata[y*newsize + x] = imagedata[oldy + (unsigned int)(x * scalex + 0.5f)];
1423 1422
 	    }