* Source/NSBitmapImageRep+PNG.m: Better cleanup on error.

* Source/NSBitmapImageRep.m (_set_bit_value): Correct error in
bit operation. This should allow the code to work with 16 bit images.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37267 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2013-10-20 20:41:52 +00:00
parent 5c7627d474
commit 35b547f964
3 changed files with 33 additions and 19 deletions

View file

@ -834,8 +834,8 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
all = ((1<<bit_width)-1) << shift;
if (byte1 != byte2)
base[byte1] = (value >> 8) | (base[byte1] ^ (all >> 8));
base[byte2] = (value & 255) | (base[byte2] ^ (all & 255));
base[byte1] = (value >> 8) | (base[byte1] & ~(all >> 8));
base[byte2] = (value & 255) | (base[byte2] & ~(all & 255));
}
/**