| 7392 | } |
| 7393 | |
| 7394 | static int stbi__psd_is16(stbi__context *s) |
| 7395 | { |
| 7396 | int channelCount, depth; |
| 7397 | if (stbi__get32be(s) != 0x38425053) { |
| 7398 | stbi__rewind( s ); |
| 7399 | return 0; |
| 7400 | } |
| 7401 | if (stbi__get16be(s) != 1) { |
| 7402 | stbi__rewind( s ); |
| 7403 | return 0; |
| 7404 | } |
| 7405 | stbi__skip(s, 6); |
| 7406 | channelCount = stbi__get16be(s); |
| 7407 | if (channelCount < 0 || channelCount > 16) { |
| 7408 | stbi__rewind( s ); |
| 7409 | return 0; |
| 7410 | } |
| 7411 | STBI_NOTUSED(stbi__get32be(s)); |
| 7412 | STBI_NOTUSED(stbi__get32be(s)); |
| 7413 | depth = stbi__get16be(s); |
| 7414 | if (depth != 16) { |
| 7415 | stbi__rewind( s ); |
| 7416 | return 0; |
| 7417 | } |
| 7418 | return 1; |
| 7419 | } |
| 7420 | #endif |
| 7421 | |
| 7422 | #ifndef STBI_NO_PIC |
no test coverage detected