8166685: We should unpin stream and pixel buffer in case of setjmp during writeImage in JPEG.
authorjdv
Thu, 29 Sep 2016 11:13:42 +0530
changeset 41404 584981a12276
parent 41403 be56daafbeaa
child 41405 0d3b7bc68b7d
8166685: We should unpin stream and pixel buffer in case of setjmp during writeImage in JPEG. Reviewed-by: prr, psadhukhan
jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
--- 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,