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