mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-20 17:46:41 +00:00
* 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:
parent
5c7627d474
commit
35b547f964
3 changed files with 33 additions and 19 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue