Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue with (non-turbo) libjpeg < 9d related to plugins/encoder_jpeg.cc #1453

Closed
jerstlouis opened this issue Jan 31, 2025 · 0 comments · Fixed by #1454
Closed

Build issue with (non-turbo) libjpeg < 9d related to plugins/encoder_jpeg.cc #1453

jerstlouis opened this issue Jan 31, 2025 · 0 comments · Fixed by #1454

Comments

@jerstlouis
Copy link
Contributor

Builds using jpeg-9a,b,c are failing due to type mismatch invoking jpeg_mem_dest().

Like libjpeg-turbo, the prototypes in non-turbo libjpeg up to jpeg-9c used unsigned long (while LIBJPEG_TURBO_VERSION is not defined):

EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
			       unsigned char ** outbuffer,
			       unsigned long * outsize));

The code in encoder_jpeg.cc declares the output size as:

#ifdef LIBJPEG_TURBO_VERSION
  unsigned long outlength = 0;
#else
  size_t outlength = 0;
#endif

so this should probably be something like:

#if defined(LIBJPEG_TURBO_VERSION) || (JPEG_LIB_VERSION_MAJOR < 9 || (JPEG_LIB_VERSION_MAJOR == 9 && JPEG_LIB_VERSION_MINOR < 4))
  unsigned long outlength = 0;
#else
  size_t outlength = 0;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant