Skip to content

Commit fe4b0fa

Browse files
Satyen SubramaniamVictor Rudometov
authored andcommitted
8332866: Crash in ImageIO JPEG decoding when MEM_STATS in enabled
Backport-of: ca3072635215755766575b4eb70dc6267969a550
1 parent dd4e0ae commit fe4b0fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/java.desktop/share/native/libjavajpeg/imageioJPEG.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -666,8 +666,6 @@ static void imageio_reset(JNIEnv *env,
666666
static void imageio_dispose(j_common_ptr info) {
667667

668668
if (info != NULL) {
669-
free(info->err);
670-
info->err = NULL;
671669
if (info->is_decompressor) {
672670
j_decompress_ptr dinfo = (j_decompress_ptr) info;
673671
free(dinfo->src);
@@ -678,6 +676,8 @@ static void imageio_dispose(j_common_ptr info) {
678676
cinfo->dest = NULL;
679677
}
680678
jpeg_destroy(info);
679+
free(info->err);
680+
info->err = NULL;
681681
free(info);
682682
}
683683
}

0 commit comments

Comments
 (0)