8166685: We should unpin stream and pixel buffer in case of setjmp during writeImage in JPEG.
Reviewed-by: prr, psadhukhan
--- 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,