Merge branch 'master' into NSImageReps_branch

This commit is contained in:
Gregory John Casamento 2019-12-03 13:11:21 -05:00
commit 95dbcd2b40
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2019-12-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...):
Correct division by zero bug in image conversion.
2019-11-03 Riccardo Mottola <rm@gnu.org>
* Headers/AppKit/NSWorkspace.h

View file

@ -2429,7 +2429,8 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
}
fa = ia / _scale;
if ((_format & NSAlphaNonpremultipliedBitmapFormat) !=
if ((ia != 0 && fa < 1.0) &&
(_format & NSAlphaNonpremultipliedBitmapFormat) !=
(bitmapFormat & NSAlphaNonpremultipliedBitmapFormat))
{
if (_format & NSAlphaNonpremultipliedBitmapFormat)
@ -2568,7 +2569,8 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
fv = iv / _scale;
fa = ia / _scale;
if ((_format & NSAlphaNonpremultipliedBitmapFormat) !=
if ((ia != 0 && fa < 1.0) &&
(_format & NSAlphaNonpremultipliedBitmapFormat) !=
(bitmapFormat & NSAlphaNonpremultipliedBitmapFormat))
{
if (_format & NSAlphaNonpremultipliedBitmapFormat)