Lines Matching refs:stbi__err
976 static int stbi__err(const char *str)
1084 // stbi__err - error
1089 #define stbi__err(x,y) 0
1091 #define stbi__err(x,y) stbi__err(y)
1093 #define stbi__err(x,y) stbi__err(x)
1096 #define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
1097 #define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
2009 if(k >= 257) return stbi__err("bad size list","Corrupt JPEG");
2023 if (code-1 >= (1u << j)) return stbi__err("bad code lengths","Corrupt JPEG");
2215 if (t < 0 || t > 15) return stbi__err("bad huffman code","Corrupt JPEG");
2221 if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta","Corrupt JPEG");
2224 if (!stbi__mul2shorts_valid(dc, dequant[0])) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
2238 if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
2246 if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
2267 if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
2275 if (t < 0 || t > 15) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
2278 if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta", "Corrupt JPEG");
2281 if (!stbi__mul2shorts_valid(dc, 1 << j->succ_low)) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
2296 if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
2316 if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
2323 if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
2365 if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
2380 if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
3102 return stbi__err("expected marker","Corrupt JPEG");
3105 if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
3115 if (p != 0 && p != 1) return stbi__err("bad DQT type","Corrupt JPEG");
3116 if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
3132 if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG");
3137 if(n > 256) return stbi__err("bad DHT header","Corrupt JPEG"); // Loop over i < n would write past end of values!
3160 return stbi__err("bad COM len","Corrupt JPEG");
3162 return stbi__err("bad APP len","Corrupt JPEG");
3197 return stbi__err("unknown marker","Corrupt JPEG");
3206 if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG");
3207 if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG");
3215 z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
3216 z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
3229 return stbi__err("bad SOS", "Corrupt JPEG");
3231 if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG");
3232 if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG");
3266 Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
3267 p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
3268 s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
3269 s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
3270 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
3271 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
3273 if (c != 3 && c != 1 && c != 4) return stbi__err("bad component count","Corrupt JPEG");
3280 if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG");
3289 z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");
3290 z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");
3291 z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
3296 if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err("too large", "Image too large to decode");
3306 if (h_max % z->img_comp[i].h != 0) return stbi__err("bad H","Corrupt JPEG");
3307 if (v_max % z->img_comp[i].v != 0) return stbi__err("bad V","Corrupt JPEG");
3337 return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
3346 return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
3370 if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
3378 if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
3434 if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
3435 if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
4044 if (!j) return stbi__err("outofmem", "Out of memory");
4070 if (!j) return stbi__err("outofmem", "Out of memory");
4135 return stbi__err("bad sizes", "Corrupt PNG");
4143 if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG");
4264 if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
4267 if (UINT_MAX - cur < (unsigned) n) return stbi__err("outofmem", "Out of memory");
4269 if(limit > UINT_MAX / 2) return stbi__err("outofmem", "Out of memory");
4274 if (q == NULL) return stbi__err("outofmem", "Out of memory");
4301 if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
4314 if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data
4319 if (z < 0 || z >= 30) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, distance codes 30 and 31 must not appear in compressed data
4322 if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
4361 if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG");
4368 if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG");
4375 return stbi__err("bad codelengths", "Corrupt PNG");
4377 if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG");
4382 if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG");
4401 if (a->num_bits < 0) return stbi__err("zlib corrupt","Corrupt PNG");
4407 if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG");
4408 if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG");
4423 if (stbi__zeof(a)) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
4424 if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
4425 if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
4426 if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png
4604 if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG");
4665 if (!a->out) return stbi__err("outofmem", "Out of memory");
4667 if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG");
4674 if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
4682 return stbi__err("invalid filter","Corrupt PNG");
4685 if (img_width_bytes > x) return stbi__err("invalid width","Corrupt PNG");
4873 if (!final) return stbi__err("outofmem", "Out of memory");
4963 if (p == NULL) return stbi__err("outofmem", "Out of memory");
5105 if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
5107 if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
5110 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
5111 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
5112 z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only");
5113 color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG");
5114 if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG");
5115 if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
5116 comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG");
5117 filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG");
5118 interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG");
5119 if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
5122 if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
5127 if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
5134 if (first) return stbi__err("first not IHDR", "Corrupt PNG");
5135 if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
5137 if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");
5148 if (first) return stbi__err("first not IHDR", "Corrupt PNG");
5149 if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
5152 if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
5153 if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
5158 if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
5159 if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
5173 if (first) return stbi__err("first not IHDR", "Corrupt PNG");
5174 if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
5181 if (c.length > (1u << 30)) return stbi__err("IDAT size limit", "IDAT section larger than 2^30 bytes");
5190 p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
5193 if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
5200 if (first) return stbi__err("first not IHDR", "Corrupt PNG");
5202 if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
5242 if (first) return stbi__err("first not IHDR", "Corrupt PNG");
5252 return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type");
6611 return stbi__err("not GIF", "Corrupt GIF");
6614 if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF");
6615 if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF");
6625 if (g->w > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
6626 if (g->h > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
6641 if (!g) return stbi__err("outofmem", "Out of memory");
7580 return stbi__err("integer parse overflow", "Parsing an integer in the PPM header overflowed a 32-bit int");
7612 return stbi__err("invalid width", "PPM image header had zero or overflowing width");
7617 return stbi__err("invalid width", "PPM image header had zero or overflowing width");
7622 return stbi__err("max value > 65535", "PPM image supports only 8-bit and 16-bit images");
7676 return stbi__err("unknown image type", "Image not of any known type, or corrupt");
7700 if (!f) return stbi__err("can't fopen", "Unable to open file");
7721 if (!f) return stbi__err("can't fopen", "Unable to open file");
7899 warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)