| 8091 | } |
| 8092 | |
| 8093 | static int stbi__psd_is16(stbi__context* s) { |
| 8094 | int channelCount, depth; |
| 8095 | if (stbi__get32be(s) != 0x38425053) { |
| 8096 | stbi__rewind(s); |
| 8097 | return 0; |
| 8098 | } |
| 8099 | if (stbi__get16be(s) != 1) { |
| 8100 | stbi__rewind(s); |
| 8101 | return 0; |
| 8102 | } |
| 8103 | stbi__skip(s, 6); |
| 8104 | channelCount = stbi__get16be(s); |
| 8105 | if (channelCount < 0 || channelCount > 16) { |
| 8106 | stbi__rewind(s); |
| 8107 | return 0; |
| 8108 | } |
| 8109 | STBI_NOTUSED(stbi__get32be(s)); |
| 8110 | STBI_NOTUSED(stbi__get32be(s)); |
| 8111 | depth = stbi__get16be(s); |
| 8112 | if (depth != 16) { |
| 8113 | stbi__rewind(s); |
| 8114 | return 0; |
| 8115 | } |
| 8116 | return 1; |
| 8117 | } |
| 8118 | #endif |
| 8119 | |
| 8120 | #ifndef STBI_NO_PIC |
no test coverage detected