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

Commit de321c32 authored by Andreas Huber's avatar Andreas Huber
Browse files

Instead of asserting, turn an unsupported colorspace conversion into a

runtime error.

Change-Id: I0a1754ecaa2a6aac8b0b1bcc829aa873cf238b9b
related-to-bug: 6499326
parent 29864609
Loading
Loading
Loading
Loading
+17 −10
Original line number Diff line number Diff line
@@ -250,8 +250,8 @@ static VideoFrame *extractVideoFrameWithCodecFlags(

    ColorConverter converter(
            (OMX_COLOR_FORMATTYPE)srcFormat, OMX_COLOR_Format16bitRGB565);
    CHECK(converter.isValid());

    if (converter.isValid()) {
        err = converter.convert(
                (const uint8_t *)buffer->data() + buffer->range_offset(),
                width, height,
@@ -260,6 +260,13 @@ static VideoFrame *extractVideoFrameWithCodecFlags(
                frame->mWidth,
                frame->mHeight,
                0, 0, frame->mWidth - 1, frame->mHeight - 1);
    } else {
        ALOGE("Unable to instantiate color conversion from format 0x%08x to "
              "RGB565",
              srcFormat);

        err = ERROR_UNSUPPORTED;
    }

    buffer->release();
    buffer = NULL;