Browse files

Fix WebpBitmapFactoryImpl.createBitmap() being called with wrong class

When JNI debugging is enabled, ART is very pedantic about what class you are passing when invoking static method. In this case, this is causing a crash:] JNI DETECTED ERROR IN APPLICATION: can't call static com.facebook.webpsupport.WebpBitmapFactoryImpl.createBitmap(int, int,$Options) with class java.lang.Class<>]     in call to CallStaticObjectMethodV]     from com.facebook.webpsupport.WebpBitmapFactoryImpl.nativeDecodeByteArray(byte[], int, int,$Options, float, byte[])
Closes #1607

Reviewed By: massimocarli, oprisnik

Differential Revision: D4386800

Pulled By: foghina

fbshipit-source-id: 876e0fb944ebb42f5ace242b67f119c57ca2464a
  • Loading branch information...
1 parent a4bec85 commit 1d4461d9afc549380cc1a9b7f58460e44a75f9f1 @korDen korDen committed with facebook-github-bot Jan 9, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 static-webp/src/main/jni/static-webp/webp_bitmapfactory.cpp
@@ -95,7 +95,7 @@ static void setBitmapSize(JNIEnv* env, jobject bitmapOptions, int image_width, i
static jobject createBitmap(JNIEnv* env, int image_width, int image_height, jobject bitmapOptions) {
- jobject bitmap = env->CallStaticObjectMethod(bitmapClass, createBitmapFunction, image_width, image_height, bitmapOptions);
+ jobject bitmap = env->CallStaticObjectMethod(webpBitmapFactoryClass, createBitmapFunction, image_width, image_height, bitmapOptions);
return bitmap;

0 comments on commit 1d4461d

Please sign in to comment.