Skip to content
Snippets Groups Projects
Commit aed28f85 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check for (and clear) Exceptions thrown by TransferParameters" into main

parents 97d6a53a 3eb6c88b
No related branches found
No related tags found
No related merge requests found
......@@ -583,6 +583,16 @@ jobject GraphicsJNI::getColorSpace(JNIEnv* env, SkColorSpace* decodeColorSpace,
transferParams.a, transferParams.b, transferParams.c, transferParams.d,
transferParams.e, transferParams.f, transferParams.g);
// Some transfer functions that are considered valid by Skia are not
// accepted by android.graphics.
if (hasException(env)) {
// Callers (e.g. Bitmap#getColorSpace) are not expected to throw an
// Exception, so clear it and return null, which is a documented
// possibility.
env->ExceptionClear();
return nullptr;
}
jfloatArray xyzArray = env->NewFloatArray(9);
jfloat xyz[9] = {
xyzMatrix.vals[0][0],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment