# HG changeset patch # User Frank Benoit # Date 1219976786 -7200 # Node ID 555d58850cd94cee1e657103338ef69d193935e4 # Parent 244e3774d515c2aa181c5fa90b7bd717eeb42dc0 Omit array bounds checking on dynamic struct length. diff -r 244e3774d515 -r 555d58850cd9 dwt/graphics/Image.d --- a/dwt/graphics/Image.d Thu Aug 28 15:57:57 2008 +0200 +++ b/dwt/graphics/Image.d Fri Aug 29 04:26:26 2008 +0200 @@ -12,7 +12,7 @@ *******************************************************************************/ module dwt.graphics.Image; - +import tango.util.log.Trace; import dwt.DWT; import dwt.DWTError; import dwt.DWTException; @@ -712,10 +712,11 @@ RGB[] rgbs = new RGB[colorPalette.Count]; paletteData = new PaletteData(rgbs); for (int i = 0; i < colorPalette.Count; i++) { - if (((palette.Entries[i] >> 24) & 0xFF) is 0 && (colorPalette.Flags & Gdip.PaletteFlagsHasAlpha) !is 0) { + // DWT: access palette.Entries without array bounds checking + if (((*(palette.Entries.ptr + i) >> 24) & 0xFF) is 0 && (colorPalette.Flags & Gdip.PaletteFlagsHasAlpha) !is 0) { transparentPixel = i; } - rgbs[i] = new RGB(((palette.Entries[i] & 0xFF0000) >> 16), ((palette.Entries[i] & 0xFF00) >> 8), ((palette.Entries[i] & 0xFF) >> 0)); + rgbs[i] = new RGB(((*(palette.Entries.ptr + i) & 0xFF0000) >> 16), ((*(palette.Entries.ptr + i) & 0xFF00) >> 8), ((*(palette.Entries.ptr + i) & 0xFF) >> 0)); } OS.HeapFree(hHeap, 0, palette); break;