Skip to content

Commit aab1e21

Browse files
committed
8358452: JNI exception pending in Java_sun_awt_screencast_ScreencastHelper_remoteDesktopKeyImpl of screencast_pipewire.c:1214 (ID: 51119)
Backport-of: 2103dc15cb662fd8795b1b51d9cb61c389bed7a0
1 parent c6af937 commit aab1e21

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_getRGBPixelsImpl
961961
const gchar *token = jtoken
962962
? (*env)->GetStringUTFChars(env, jtoken, NULL)
963963
: NULL;
964+
JNU_CHECK_EXCEPTION_RETURN(env, RESULT_ERROR);
964965

965966
isGtkMainThread = gtk->g_main_context_is_owner(gtk->g_main_context_default());
966967
DEBUG_SCREENCAST(
@@ -1066,7 +1067,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopMou
10661067
const gchar *token = jtoken
10671068
? (*env)->GetStringUTFChars(env, jtoken, NULL)
10681069
: NULL;
1069-
1070+
JNU_CHECK_EXCEPTION_RETURN(env, RESULT_ERROR);
10701071

10711072
DEBUG_SCREENCAST("moving mouse to\n\t%d %d\n\twith token |%s|\n", jx, jy, token);
10721073

@@ -1096,6 +1097,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopMou
10961097
const gchar *token = jtoken
10971098
? (*env)->GetStringUTFChars(env, jtoken, NULL)
10981099
: NULL;
1100+
JNU_CHECK_EXCEPTION_RETURN(env, RESULT_ERROR);
10991101

11001102
gboolean result = initPortal(token, NULL, 0);
11011103
DEBUG_SCREENCAST("init result %b, mouse pressing %d\n", result, buttons)
@@ -1123,6 +1125,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopMou
11231125
const gchar *token = jtoken
11241126
? (*env)->GetStringUTFChars(env, jtoken, NULL)
11251127
: NULL;
1128+
JNU_CHECK_EXCEPTION_RETURN(env, RESULT_ERROR);
11261129

11271130
gboolean result = initPortal(token, NULL, 0);
11281131
DEBUG_SCREENCAST("init result %b, mouse wheel %d\n", result, jWheelAmt)
@@ -1151,13 +1154,14 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopKey
11511154
int key = awt_getX11KeySym(jkey);
11521155
AWT_UNLOCK();
11531156

1154-
if (key == NoSymbol) {
1157+
if (key == NoSymbol || (*env)->ExceptionCheck(env)) {
11551158
return RESULT_ERROR;
11561159
}
11571160

11581161
const gchar *token = jtoken
11591162
? (*env)->GetStringUTFChars(env, jtoken, NULL)
11601163
: NULL;
1164+
JNU_CHECK_EXCEPTION_RETURN(env, RESULT_ERROR);
11611165

11621166
gboolean result = initPortal(token, NULL, 0);
11631167
DEBUG_SCREENCAST("init result %b, key %d -> %d isPress %b\n", result, jkey, key, isPress)

0 commit comments

Comments
 (0)