From a503dabe01b6e868a0628fbc10e787dc389381dd Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 20 Oct 2013 23:23:25 -0700 Subject: [PATCH] Fixed a crash initializing Android touch IDs --- src/core/android/SDL_android.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 688055bbf..763715e68 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1200,9 +1200,9 @@ int Android_JNI_GetTouchDeviceIds(int **ids) { jint* elements = (*env)->GetIntArrayElements(env, array, NULL); if (elements) { int i; - *ids = SDL_malloc(number * sizeof (*ids[0])); + *ids = SDL_malloc(number * sizeof (**ids)); for (i = 0; i < number; ++i) { /* not assuming sizeof (jint) == sizeof (int) */ - *ids[i] = elements[i]; + (*ids)[i] = elements[i]; } (*env)->ReleaseIntArrayElements(env, array, elements, JNI_ABORT); }