PSDTranslator: Fix array size
This commit is contained in:
parent
af6518e48e
commit
63b8eb480e
@ -77,7 +77,7 @@ PSDLoader::IsSupported(void)
|
||||
if (fVersion != 1)
|
||||
return false;
|
||||
|
||||
if (fChannels < 0 || fChannels > 16)
|
||||
if (fChannels < 0 || fChannels > PSD_MAX_CHANNELS)
|
||||
return false;
|
||||
|
||||
if (fDepth > 16)
|
||||
@ -190,7 +190,7 @@ PSDLoader::Decode(BPositionIO *target)
|
||||
int32 rowBytes = (fWidth * fDepth) / 8;
|
||||
int32 channelBytes = rowBytes * fHeight;
|
||||
|
||||
uint8 *imageData[5];
|
||||
uint8 *imageData[PSD_MAX_CHANNELS];
|
||||
for (int i = 0; i < fChannels; i++)
|
||||
imageData[i] = new uint8[channelBytes];
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <ByteOrder.h>
|
||||
#include <List.h>
|
||||
|
||||
#define PSD_MAX_CHANNELS 16
|
||||
|
||||
|
||||
enum psd_compressed_type {
|
||||
PSD_COMPRESSED_RAW = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user