From 4ee91a4a25a79c380c5b6eb27cc2e7baf8739e75 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 28 Jul 2013 15:49:11 -0400 Subject: [PATCH] fix narrowing issue in miniz - closes #1967 --- src/miniz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miniz.c b/src/miniz.c index 76b5634d0..02aa52c8b 100644 --- a/src/miniz.c +++ b/src/miniz.c @@ -2778,7 +2778,7 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, *pLen_out = out_buf.m_size-41; { mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, - 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0, + 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8, (mz_uint8)"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0, (mz_uint8)(*pLen_out>>24),(mz_uint8)(*pLen_out>>16),(mz_uint8)(*pLen_out>>8),(mz_uint8)*pLen_out,0x49,0x44,0x41,0x54}; c=(mz_uint32)mz_crc32(MZ_CRC32_INIT,pnghdr+12,17); for (i=0; i<4; ++i, c<<=8) ((mz_uint8*)(pnghdr+29))[i]=(mz_uint8)(c>>24); memcpy(out_buf.m_pBuf, pnghdr, 41);