diff --git a/ChangeLog b/ChangeLog index a49a0bcc7..70324cbd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Apr 9 17:20:35 CEST 2011 (acab) +------------------------------------ + * libclamav/pe_icons.c: don't sigbus on sparc (bb#2695) + Sat Apr 9 03:56:17 CEST 2011 (acab) ------------------------------------ * libclamav/pe.c: reset corrupted status before bytecode hooks (bb#2544) diff --git a/libclamav/pe_icons.c b/libclamav/pe_icons.c index 21de670a1..fb822392c 100644 --- a/libclamav/pe_icons.c +++ b/libclamav/pe_icons.c @@ -29,8 +29,8 @@ #include "others.h" -#define EC32(x) le32_to_host(x) -#define EC16(x) le16_to_host(x) +#define READ32(x) cli_readint32(&(x)) +#define READ16(x) cli_readint16(&(x)) #define USE_FLOATS #ifdef USE_FLOATS #define LABDIFF(x) labdiff(x) @@ -1222,17 +1222,17 @@ static int parseicon(icon_groupset *set, uint32_t rva, cli_ctx *ctx, struct cli_ return CL_SUCCESS; } - if(EC32(bmphdr.sz) < sizeof(bmphdr)) { + if(READ32(bmphdr.sz) < sizeof(bmphdr)) { cli_dbgmsg("parseicon: BMP header too small\n"); return CL_SUCCESS; } /* seek to the end of v4/v5 header */ - icoff += EC32(bmphdr.sz); + icoff += READ32(bmphdr.sz); - width = EC32(bmphdr.w); - height = EC32(bmphdr.h) / 2; - depth = EC16(bmphdr.depth); + width = READ32(bmphdr.w); + height = READ32(bmphdr.h) / 2; + depth = READ16(bmphdr.depth); if(width > 256 || height > 256 || width < 16 || height < 16) { cli_dbgmsg("parseicon: Image too small or too big (%ux%u)\n", width, height); return CL_SUCCESS; @@ -1308,7 +1308,7 @@ static int parseicon(icon_groupset *set, uint32_t rva, cli_ctx *ctx, struct cli_ have = 8; } have -= depth; - imagedata[(height - 1 - y) * width + x] = EC32(palette[(c >> have) & ((1<> have) & ((1<