Fix for the safty check. It checks that nFir21 + jNpoints <= BUF_SIZE,

but when it calls GetByteArrayRegion, it multiplies it by 2 which
 defeats the "// safety first" check at the beginning.
This commit is contained in:
Gloria Wang
2010-02-22 15:56:21 -08:00
parent bc92766cfd
commit 196863d274

View File

@@ -92,7 +92,7 @@ static void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass clazz,
jint jNpoints) {
// safety first!
if (nFir21 + jNpoints > BUF_SIZE) {
if (nFir21 + jNpoints * 2 > BUF_SIZE) {
throwException(env, "java/lang/IllegalArgumentException",
"FIR+data too long %d", nFir21 + jNpoints);
return;