Skip to content

Commit

Permalink
Resolved segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 1, 2019
1 parent 78995c8 commit 4f3b449
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
17 changes: 3 additions & 14 deletions Tests/test_qt_image_fromqpixmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ def roundtrip(self, expected):
# Qt saves all pixmaps as rgb
self.assert_image_equal(result, expected.convert('RGB'))

def test_sanity_1(self):
self.roundtrip(hopper('1'))

def test_sanity_rgb(self):
self.roundtrip(hopper('RGB'))

def test_sanity_rgba(self):
self.roundtrip(hopper('RGBA'))

def test_sanity_l(self):
self.roundtrip(hopper('L'))

def test_sanity_p(self):
self.roundtrip(hopper('P'))
def test_sanity(self):
for mode in ('1', 'RGB', 'RGBA', 'L', 'P'):
self.roundtrip(hopper(mode))
4 changes: 2 additions & 2 deletions src/libImaging/Convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,8 @@ static void
p2pa(UINT8* out, const UINT8* in, int xsize, const UINT8* palette)
{
int x;
for (x = 0; x < xsize; x++, in+=4) {
const UINT8* rgba = &palette[in[0] * 4];
for (x = 0; x < xsize; x++, in++) {
const UINT8* rgba = &palette[in[0]];
*out++ = in[0];
*out++ = in[0];
*out++ = in[0];
Expand Down

0 comments on commit 4f3b449

Please sign in to comment.