Skip to content

Commit

Permalink
Use NULL instead of 0 for pointer arguments of CallStaticVoidMethod.
Browse files Browse the repository at this point in the history
CallStaticVoidMethod is varargs function, and calling it with
a literal 0 like CallStaticVoidMethod(..., 0) will treat the
argument as a 4 byte int in both 32 and 64 bit processes.

This is incorrect for pointer arguments where NULL should be
used instead.

Reviewed-by: Liao, Bruce <bruce.liao@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>

Change-Id: I9d700d3790a80dbee6826f64baf9ef5d81ca390f
  • Loading branch information
fenghaitao authored and Chairshot215 committed Jan 13, 2015
1 parent 1be740d commit 1cca228
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion media/jni/android_media_MediaRecorder.cpp
Expand Up @@ -102,7 +102,7 @@ void JNIMediaRecorderListener::notify(int msg, int ext1, int ext2)
ALOGV("JNIMediaRecorderListener::notify");

JNIEnv *env = AndroidRuntime::getJNIEnv();
env->CallStaticVoidMethod(mClass, fields.post_event, mObject, msg, ext1, ext2, 0);
env->CallStaticVoidMethod(mClass, fields.post_event, mObject, msg, ext1, ext2, NULL);
}

// ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion media/jni/audioeffect/android_media_Visualizer.cpp
Expand Up @@ -329,7 +329,7 @@ static void android_media_visualizer_effect_callback(int32_t event,
fields.midPostNativeEvent,
callbackInfo->visualizer_ref,
NATIVE_EVENT_SERVER_DIED,
0, 0, 0);
0, 0, NULL);
}
}

Expand Down

0 comments on commit 1cca228

Please sign in to comment.