changeset 41404:584981a12276

8166685: We should unpin stream and pixel buffer in case of setjmp during writeImage in JPEG. Reviewed-by: prr, psadhukhan
author jdv
date Thu, 29 Sep 2016 11:13:42 +0530
parents be56daafbeaa
children 0d3b7bc68b7d
files jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Thu Sep 29 10:57:34 2016 +0530
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Thu Sep 29 11:13:42 2016 +0530
@@ -2872,6 +2872,7 @@
     if (setjmp(jerr->setjmp_buffer)) {
         /* If we get here, the JPEG code has signaled an error
            while writing. */
+        RELEASE_ARRAYS(env, data, (const JOCTET *)(dest->next_output_byte));
         if (!(*env)->ExceptionOccurred(env)) {
             char buffer[JMSG_LENGTH_MAX];
             (*cinfo->err->format_message) ((j_common_ptr) cinfo,