Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8840bd9 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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
parent 4c0487a1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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: