Skip to content

Commit

Permalink
Fixed a crash initializing Android touch IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 21, 2013
1 parent f8c11bb commit a503dab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/android/SDL_android.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit a503dab

Please sign in to comment.