Commit b1fc7d4d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩 Committed by Ronan

Fixed crash in string constructor if const char * is NULL

parent 818da796
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "platform-helpers.h" #include "platform-helpers.h"
#include "logger/logger.h" #include "logger/logger.h"
#include "c-wrapper/c-wrapper.h"
// TODO: Remove me later. // TODO: Remove me later.
#include "private.h" #include "private.h"
...@@ -242,7 +243,7 @@ int AndroidPlatformHelpers::callVoidMethod (jmethodID id) { ...@@ -242,7 +243,7 @@ int AndroidPlatformHelpers::callVoidMethod (jmethodID id) {
void AndroidPlatformHelpers::setVideoPreviewWindow (void *windowId) { void AndroidPlatformHelpers::setVideoPreviewWindow (void *windowId) {
JNIEnv *env = ms_get_jni_env(); JNIEnv *env = ms_get_jni_env();
if (env && mJavaHelper) { if (env && mJavaHelper) {
string displayFilter = linphone_core_get_video_display_filter(getCore()); string displayFilter = L_C_TO_STRING(linphone_core_get_video_display_filter(getCore()));
if (windowId && (displayFilter.empty() || displayFilter == "MSAndroidTextureDisplay")) { if (windowId && (displayFilter.empty() || displayFilter == "MSAndroidTextureDisplay")) {
env->CallVoidMethod(mJavaHelper, mSetNativePreviewVideoWindowId, (jobject)windowId); env->CallVoidMethod(mJavaHelper, mSetNativePreviewVideoWindowId, (jobject)windowId);
} else { } else {
...@@ -254,7 +255,7 @@ void AndroidPlatformHelpers::setVideoPreviewWindow (void *windowId) { ...@@ -254,7 +255,7 @@ void AndroidPlatformHelpers::setVideoPreviewWindow (void *windowId) {
void AndroidPlatformHelpers::setVideoWindow (void *windowId) { void AndroidPlatformHelpers::setVideoWindow (void *windowId) {
JNIEnv *env = ms_get_jni_env(); JNIEnv *env = ms_get_jni_env();
if (env && mJavaHelper) { if (env && mJavaHelper) {
string displayFilter = linphone_core_get_video_display_filter(getCore()); string displayFilter = L_C_TO_STRING(linphone_core_get_video_display_filter(getCore()));
if (windowId && (displayFilter.empty() || displayFilter == "MSAndroidTextureDisplay")) { if (windowId && (displayFilter.empty() || displayFilter == "MSAndroidTextureDisplay")) {
env->CallVoidMethod(mJavaHelper, mSetNativeVideoWindowId, (jobject)windowId); env->CallVoidMethod(mJavaHelper, mSetNativeVideoWindowId, (jobject)windowId);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment