MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi__grow_buffer_unsafe

Function stbi__grow_buffer_unsafe

Source/Utils/stb_image.h:2074–2090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2072}
2073
2074static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
2075{
2076 do {
2077 unsigned int b = j->nomore ? 0 : stbi__get8(j->s);
2078 if (b == 0xff) {
2079 int c = stbi__get8(j->s);
2080 while (c == 0xff) c = stbi__get8(j->s); // consume fill bytes
2081 if (c != 0) {
2082 j->marker = (unsigned char) c;
2083 j->nomore = 1;
2084 return;
2085 }
2086 }
2087 j->code_buffer |= b << (24 - j->code_bits);
2088 j->code_bits += 8;
2089 } while (j->code_bits <= 24);
2090}
2091
2092// (1 << n) - 1
2093static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};

Callers 8

stbi__jpeg_huff_decodeFunction · 0.85
stbi__extend_receiveFunction · 0.85
stbi__jpeg_get_bitsFunction · 0.85
stbi__jpeg_get_bitFunction · 0.85
stbi__jpeg_decode_blockFunction · 0.85

Calls 1

stbi__get8Function · 0.85

Tested by

no test coverage detected