Fix broken JPEG decoding (tested on Windows)

This commit is contained in:
Joshua Granick
2024-07-09 13:27:54 -07:00
parent 88e21e6cc9
commit 656c761cb0
2 changed files with 15 additions and 2 deletions

View File

@@ -19,7 +19,9 @@
#define MEM_SRCDST_SUPPORTED 1 #define MEM_SRCDST_SUPPORTED 1
/* Use accelerated SIMD routines. */ /* Use accelerated SIMD routines. */
#ifndef __ANDROID__
#define WITH_SIMD 1 #define WITH_SIMD 1
#endif
/* /*
* Define BITS_IN_JSAMPLE as either * Define BITS_IN_JSAMPLE as either
@@ -67,9 +69,10 @@
#endif #endif
/* If rpcndr.h has defined boolean, jmorecfg.h should not. */ /* If rpcndr.h has defined boolean, jmorecfg.h should not. */
#ifdef __RPCNDR_H__ #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
#define HAVE_BOOLEAN typedef unsigned char boolean;
#endif #endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */

View File

@@ -25,9 +25,19 @@ namespace lime {
static void OnOutput (j_common_ptr cinfo) {} static void OnOutput (j_common_ptr cinfo) {}
// #ifdef NDEBUG
// char errorMessage[JMSG_LENGTH_MAX];
// #endif
static void OnError (j_common_ptr cinfo) { static void OnError (j_common_ptr cinfo) {
ErrorData * err = (ErrorData *)cinfo->err; ErrorData * err = (ErrorData *)cinfo->err;
// #ifdef NDEBUG
// ( *(cinfo->err->format_message) ) (cinfo, errorMessage);
// fprintf(stderr, "%s\n", errorMessage);
// #endif
longjmp (err->on_error, 1); longjmp (err->on_error, 1);
} }