Skip to content

Commit

Permalink
maybe fix crash in PDF files with jpx images by making opj_secret thr…
Browse files Browse the repository at this point in the history
…ead-local
  • Loading branch information
kjk committed Sep 10, 2024
1 parent beec851 commit e31eef3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mupdf/source/fitz/load-jpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ typedef struct
* threading systems.
*/

static fz_context *opj_secret = NULL;
/* SumatraPDF: opening multiple PDF files with jpx imags will crash because different
* threads will clobber opj_secret. Locking is not good enough
*/
__declspec(thread) static fz_context *opj_secret = NULL;

static void set_opj_context(fz_context *ctx)
{
Expand Down

0 comments on commit e31eef3

Please sign in to comment.