|
Line 0
Link Here
|
|
|
1 |
From ae453aa18b66af54e7ff716f4ccb33adca60afd4 Mon Sep 17 00:00:00 2001 |
| 2 |
From: wiredfool <eric-github@soroos.net> |
| 3 |
Date: Tue, 2 Feb 2016 05:46:26 -0800 |
| 4 |
Subject: [PATCH] PCD decoder overruns the shuffle buffer, Fixes #568 |
| 5 |
|
| 6 |
--- |
| 7 |
Tests/images/hopper.pcd | Bin 0 -> 788480 bytes |
| 8 |
Tests/test_file_pcd.py | 18 ++++++++++++++++++ |
| 9 |
libImaging/PcdDecode.c | 4 ++-- |
| 10 |
3 files changed, 20 insertions(+), 2 deletions(-) |
| 11 |
create mode 100644 Tests/images/hopper.pcd |
| 12 |
create mode 100644 Tests/test_file_pcd.py |
| 13 |
|
| 14 |
--- libImaging/PcdDecode.c |
| 15 |
+++ libImaging/PcdDecode.c |
| 16 |
@@ -47,7 +47,7 @@ ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) |
| 17 |
out[0] = ptr[x]; |
| 18 |
out[1] = ptr[(x+4*state->xsize)/2]; |
| 19 |
out[2] = ptr[(x+5*state->xsize)/2]; |
| 20 |
- out += 4; |
| 21 |
+ out += 3; |
| 22 |
} |
| 23 |
|
| 24 |
state->shuffle((UINT8*) im->image[state->y], |
| 25 |
@@ -62,7 +62,7 @@ ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) |
| 26 |
out[0] = ptr[x+state->xsize]; |
| 27 |
out[1] = ptr[(x+4*state->xsize)/2]; |
| 28 |
out[2] = ptr[(x+5*state->xsize)/2]; |
| 29 |
- out += 4; |
| 30 |
+ out += 3; |
| 31 |
} |
| 32 |
|
| 33 |
state->shuffle((UINT8*) im->image[state->y], |