diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-01-22 17:25:28 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-01-22 17:25:28 +0200 |
commit | c9d9042affc3235286e1cf6bf1d4e4b6fcecc682 (patch) | |
tree | 8f383fc5ba5a574d6a9a4e04f619a3293cb63f55 /sys | |
parent | 551b0a5f28f32715aa1d27c66336cd2add80a084 (diff) | |
download | gstreamer-plugins-bad-c9d9042affc3235286e1cf6bf1d4e4b6fcecc682.tar.gz |
ahc: Fail gracefully if our callback class can't be found
Instead of just ignoring that error and then calling JNI functions with NULL,
which will kill the virtual machine.
The error handling here needs some further improvements though, errors in more
places are just ignored.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/androidmedia/gst-android-hardware-camera.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/androidmedia/gst-android-hardware-camera.c b/sys/androidmedia/gst-android-hardware-camera.c index fe4c80ebc..3a78470b7 100644 --- a/sys/androidmedia/gst-android-hardware-camera.c +++ b/sys/androidmedia/gst-android-hardware-camera.c @@ -1663,6 +1663,9 @@ _init_classes (void) gst_amc_jni_get_class (env, &err, "org/freedesktop/gstreamer/androidmedia/GstAhcCallback"); } + if (!org_freedesktop_gstreamer_androidmedia_gstahccallback.klass) + goto failed; + org_freedesktop_gstreamer_androidmedia_gstahccallback.constructor = gst_amc_jni_get_method_id (env, &err, org_freedesktop_gstreamer_androidmedia_gstahccallback.klass, "<init>", |