| 7354 | |
| 7355 | #ifndef STBI_NO_PSD |
| 7356 | static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp) |
| 7357 | { |
| 7358 | int channelCount, dummy, depth; |
| 7359 | if (!x) x = &dummy; |
| 7360 | if (!y) y = &dummy; |
| 7361 | if (!comp) comp = &dummy; |
| 7362 | if (stbi__get32be(s) != 0x38425053) { |
| 7363 | stbi__rewind( s ); |
| 7364 | return 0; |
| 7365 | } |
| 7366 | if (stbi__get16be(s) != 1) { |
| 7367 | stbi__rewind( s ); |
| 7368 | return 0; |
| 7369 | } |
| 7370 | stbi__skip(s, 6); |
| 7371 | channelCount = stbi__get16be(s); |
| 7372 | if (channelCount < 0 || channelCount > 16) { |
| 7373 | stbi__rewind( s ); |
| 7374 | return 0; |
| 7375 | } |
| 7376 | *y = stbi__get32be(s); |
| 7377 | *x = stbi__get32be(s); |
| 7378 | depth = stbi__get16be(s); |
| 7379 | if (depth != 8 && depth != 16) { |
| 7380 | stbi__rewind( s ); |
| 7381 | return 0; |
| 7382 | } |
| 7383 | if (stbi__get16be(s) != 3) { |
| 7384 | stbi__rewind( s ); |
| 7385 | return 0; |
| 7386 | } |
| 7387 | *comp = 4; |
| 7388 | return 1; |
| 7389 | } |
| 7390 | |
| 7391 | static int stbi__psd_is16(stbi__context *s) |
| 7392 | { |
no test coverage detected