| 8054 | |
| 8055 | #ifndef STBI_NO_PSD |
| 8056 | static int stbi__psd_info(stbi__context* s, int* x, int* y, int* comp) { |
| 8057 | int channelCount, dummy, depth; |
| 8058 | if (!x) |
| 8059 | x = &dummy; |
| 8060 | if (!y) |
| 8061 | y = &dummy; |
| 8062 | if (!comp) |
| 8063 | comp = &dummy; |
| 8064 | if (stbi__get32be(s) != 0x38425053) { |
| 8065 | stbi__rewind(s); |
| 8066 | return 0; |
| 8067 | } |
| 8068 | if (stbi__get16be(s) != 1) { |
| 8069 | stbi__rewind(s); |
| 8070 | return 0; |
| 8071 | } |
| 8072 | stbi__skip(s, 6); |
| 8073 | channelCount = stbi__get16be(s); |
| 8074 | if (channelCount < 0 || channelCount > 16) { |
| 8075 | stbi__rewind(s); |
| 8076 | return 0; |
| 8077 | } |
| 8078 | *y = stbi__get32be(s); |
| 8079 | *x = stbi__get32be(s); |
| 8080 | depth = stbi__get16be(s); |
| 8081 | if (depth != 8 && depth != 16) { |
| 8082 | stbi__rewind(s); |
| 8083 | return 0; |
| 8084 | } |
| 8085 | if (stbi__get16be(s) != 3) { |
| 8086 | stbi__rewind(s); |
| 8087 | return 0; |
| 8088 | } |
| 8089 | *comp = 4; |
| 8090 | return 1; |
| 8091 | } |
| 8092 | |
| 8093 | static int stbi__psd_is16(stbi__context* s) { |
| 8094 | int channelCount, depth; |
no test coverage detected