Update to libjpeg-turbo 2.1.3

This commit is contained in:
Kornel
2022-05-23 16:06:07 +01:00
parent 5e797fa699
commit 5c6a0f0971
4 changed files with 6 additions and 6 deletions

View File

@@ -101,7 +101,7 @@ jpeg_CreateCompress(j_compress_ptr cinfo, int version, size_t structsize)
cinfo->master = (struct jpeg_comp_master *) cinfo->master = (struct jpeg_comp_master *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
sizeof(my_comp_master)); sizeof(my_comp_master));
MEMZERO(cinfo->master, sizeof(my_comp_master)); memset(cinfo->master, 0, sizeof(my_comp_master));
cinfo->master->compress_profile = JCP_MAX_COMPRESSION; cinfo->master->compress_profile = JCP_MAX_COMPRESSION;
} }

View File

@@ -603,7 +603,7 @@ copy_buffer (j_compress_ptr cinfo, int scan_idx)
while (size >= cinfo->dest->free_in_buffer) while (size >= cinfo->dest->free_in_buffer)
{ {
MEMCOPY(cinfo->dest->next_output_byte, src, cinfo->dest->free_in_buffer); memcpy(cinfo->dest->next_output_byte, src, cinfo->dest->free_in_buffer);
src += cinfo->dest->free_in_buffer; src += cinfo->dest->free_in_buffer;
size -= cinfo->dest->free_in_buffer; size -= cinfo->dest->free_in_buffer;
cinfo->dest->next_output_byte += cinfo->dest->free_in_buffer; cinfo->dest->next_output_byte += cinfo->dest->free_in_buffer;
@@ -613,7 +613,7 @@ copy_buffer (j_compress_ptr cinfo, int scan_idx)
ERREXIT(cinfo, JERR_UNSUPPORTED_SUSPEND); ERREXIT(cinfo, JERR_UNSUPPORTED_SUSPEND);
} }
MEMCOPY(cinfo->dest->next_output_byte, src, size); memcpy(cinfo->dest->next_output_byte, src, size);
cinfo->dest->next_output_byte += size; cinfo->dest->next_output_byte += size;
cinfo->dest->free_in_buffer -= size; cinfo->dest->free_in_buffer -= size;
} }

View File

@@ -657,7 +657,7 @@ main(int argc, char **argv)
fprintf(stderr, "%s: memory allocation failure\n", progname); fprintf(stderr, "%s: memory allocation failure\n", progname);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
nbytes = JFREAD(fp, &inbuffer[insize], INPUT_BUF_SIZE); nbytes = fread(&inbuffer[insize], 1, INPUT_BUF_SIZE, fp);
if (nbytes < INPUT_BUF_SIZE && ferror(fp)) { if (nbytes < INPUT_BUF_SIZE && ferror(fp)) {
if (file_index < argc) if (file_index < argc)
fprintf(stderr, "%s: can't read from %s\n", progname, fprintf(stderr, "%s: can't read from %s\n", progname,
@@ -790,7 +790,7 @@ main(int argc, char **argv)
buffer = inbuffer; buffer = inbuffer;
} }
nbytes = JFWRITE(fp, buffer, size); nbytes = fwrite(buffer, 1, size, fp);
if (nbytes < size && ferror(fp)) { if (nbytes < size && ferror(fp)) {
if (file_index < argc) if (file_index < argc)
fprintf(stderr, "%s: can't write to %s\n", progname, fprintf(stderr, "%s: can't write to %s\n", progname,

View File

@@ -288,7 +288,7 @@ static void setCompDefaults(struct jpeg_compress_struct *cinfo,
cinfo->in_color_space = pf2cs[pixelFormat]; cinfo->in_color_space = pf2cs[pixelFormat];
cinfo->input_components = tjPixelSize[pixelFormat]; cinfo->input_components = tjPixelSize[pixelFormat];
#ifndef NO_GETENV #ifndef NO_GETENV
if((env=getenv("TJ_REVERT"))!=NULL && strlen(env)>0 && !strcmp(env, "1")) if (!GETENV_S(env, 7, "TJ_REVERTe") && !strcmp(env, "1"))
cinfo->master->compress_profile=JCP_FASTEST; cinfo->master->compress_profile=JCP_FASTEST;
#endif #endif
jpeg_set_defaults(cinfo); jpeg_set_defaults(cinfo);