mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Fix crash if pixels are null.
This commit is contained in:
@@ -29,7 +29,10 @@ jobject nativeDecodeBitmap(JNIEnv *env, jobject, jbyteArray data) {
|
||||
int height;
|
||||
|
||||
uint8_t *pixels = WebPDecodeBGRA(buffer, bufferLength, &width, &height);
|
||||
jobject jbitmap = createBitmap(env, width, height, pixels);
|
||||
jobject jbitmap = nullptr;
|
||||
if (pixels != nullptr) {
|
||||
jbitmap = createBitmap(env, width, height, pixels);
|
||||
}
|
||||
|
||||
WebPFree(pixels);
|
||||
env->ReleaseByteArrayElements(data, javaBytes, 0);
|
||||
|
||||
Reference in New Issue
Block a user