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

View File

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