Skip to content

Commit

Permalink
8332866: Crash in ImageIO JPEG decoding when MEM_STATS in enabled
Browse files Browse the repository at this point in the history
Reviewed-by: abhiscxk, psadhukhan
  • Loading branch information
jayathirthrao committed Jun 4, 2024
1 parent 29e10e4 commit ca30726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -666,8 +666,6 @@ static void imageio_reset(JNIEnv *env,
static void imageio_dispose(j_common_ptr info) {

if (info != NULL) {
free(info->err);
info->err = NULL;
if (info->is_decompressor) {
j_decompress_ptr dinfo = (j_decompress_ptr) info;
free(dinfo->src);
Expand All @@ -678,6 +676,8 @@ static void imageio_dispose(j_common_ptr info) {
cinfo->dest = NULL;
}
jpeg_destroy(info);
free(info->err);
info->err = NULL;
free(info);
}
}
Expand Down

0 comments on commit ca30726

Please sign in to comment.