diff options
author | Leon Scroggins III <scroggo@google.com> | 2020-01-15 04:09:48 -0500 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2020-01-15 04:09:48 -0500 |
commit | d8840bd9f0cf636e8acfc12f9b49ce62a35d7bef (patch) | |
tree | 1a67a6db4836d1290c64383063401d4e6dddd1dd | |
parent | 4c0487a163ab3a51e26e730587967fdb79f69845 (diff) |
Update AImageDecoder_getAlphaFlags return value
Bug: 135133301
Test: I2ea58bede5cf49a7947c96e7e6e37f967632ad6b
BAD_PARAMETER is a more sensible value than -1. The other return will
not be reached, but the code is clearer.
Change-Id: I4bee8f238f61a6c6cd13b5458f201f34d34315d9
-rw-r--r-- | native/graphics/jni/imagedecoder.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/native/graphics/jni/imagedecoder.cpp b/native/graphics/jni/imagedecoder.cpp index 2ef203dd466f..a13cc02b41d0 100644 --- a/native/graphics/jni/imagedecoder.cpp +++ b/native/graphics/jni/imagedecoder.cpp @@ -225,13 +225,12 @@ AndroidBitmapFormat AImageDecoderHeaderInfo_getAndroidBitmapFormat( int AImageDecoderHeaderInfo_getAlphaFlags(const AImageDecoderHeaderInfo* info) { if (!info) { - // FIXME: Better invalid? - return -1; + return ANDROID_IMAGE_DECODER_BAD_PARAMETER; } switch (toDecoder(info)->mCodec->getInfo().alphaType()) { case kUnknown_SkAlphaType: LOG_ALWAYS_FATAL("Invalid alpha type"); - return -1; + return ANDROID_IMAGE_DECODER_INTERNAL_ERROR; case kUnpremul_SkAlphaType: // fall through. premul is the default. case kPremul_SkAlphaType: |