Fixed a crash initializing Android touch IDs
authorSam Lantinga <slouken@libsdl.org>
Sun, 20 Oct 2013 23:23:25 -0700
changeset 7863 c6b33210e610
parent 7862 d20e37f08533
child 7864 fdada7e3b3e7
Fixed a crash initializing Android touch IDs
src/core/android/SDL_android.c
--- a/src/core/android/SDL_android.c	Sun Oct 20 23:05:53 2013 -0700
+++ b/src/core/android/SDL_android.c	Sun Oct 20 23:23:25 2013 -0700
@@ -1200,9 +1200,9 @@
             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);
             }