--- output-jpeg.c 2023-02-07 12:48:20.328740181 -1000 +++ output-jpeg.c.new 2023-02-07 12:50:24.268536252 -1000 @@ -28,10 +28,16 @@ #define JZ_CTX_FROM_CINFO(c) (fz_context *)((c)->client_data) +static void fz_jpg_mem_init(j_common_ptr cinfo, fz_context *ctx) +{ + cinfo->client_data = ctx; +} + +#define fz_jpg_mem_term(cinfo) + #else /* SHARE_JPEG */ typedef void * backing_store_ptr; - #include "jmemcust.h" #define JZ_CTX_FROM_CINFO(c) (fz_context *)(GET_CUST_MEM_DATA(c)->priv) @@ -76,7 +82,7 @@ } } -#endif +#endif /* SHARE_JPEG */ #define OUTPUT_BUF_SIZE (16<<10) @@ -92,6 +98,7 @@ { char msg[JMSG_LENGTH_MAX]; fz_context *ctx = JZ_CTX_FROM_CINFO(cinfo); + cinfo->err->format_message(cinfo, msg); fz_throw(ctx, FZ_ERROR_GENERIC, "jpeg error: %s", msg); }