From f4bfa6bec5e9a35c03aa0e90df73ead307b1542d Mon Sep 17 00:00:00 2001 From: Lukasz Kozakiewicz Date: Fri, 1 Sep 2017 16:39:08 +0100 Subject: [PATCH] Android: fix a crash in painting when size of the array to allocate is 0. --- modules/juce_gui_basics/native/juce_android_Windowing.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index 9240440be1..54fa3ea608 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -526,6 +526,10 @@ public: sizeAllocated = sizeNeeded; buffer = GlobalRef (env->NewIntArray (sizeNeeded)); } + else if (sizeNeeded == 0) + { + return; + } if (jint* dest = env->GetIntArrayElements ((jintArray) buffer.get(), 0)) {