MCPcopy Create free account
hub / github.com/DentonW/DevIL / fill_input_buffer

Function fill_input_buffer

DevIL/src-IL/src/il_jpeg.cpp:231–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229
230METHODDEF(boolean)
231fill_input_buffer (j_decompress_ptr cinfo)
232{
233 iread_ptr src = (iread_ptr) cinfo->src;
234 ILint nbytes;
235
236 nbytes = iread(src->buffer, 1, INPUT_BUF_SIZE);
237
238 if (nbytes <= 0) {
239 if (src->start_of_file) { // Treat empty input file as fatal error
240 //ERREXIT(cinfo, JERR_INPUT_EMPTY);
241 jpgErrorOccured = IL_TRUE;
242 }
243 //WARNMS(cinfo, JWRN_JPEG_EOF);
244 // Insert a fake EOI marker
245 src->buffer[0] = (JOCTET) 0xFF;
246 src->buffer[1] = (JOCTET) JPEG_EOI;
247 nbytes = 2;
248 return IL_FALSE;
249 }
250 if (nbytes < INPUT_BUF_SIZE) {
251 ilGetError(); // Gets rid of the IL_FILE_READ_ERROR.
252 }
253
254 src->pub.next_input_byte = src->buffer;
255 src->pub.bytes_in_buffer = nbytes;
256 src->start_of_file = IL_FALSE;
257
258 return IL_TRUE;
259}
260
261
262METHODDEF(void)

Callers 1

skip_input_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected