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

Commit 4e5e4851 authored by Praveen Chavan's avatar Praveen Chavan Committed by Linux Build Service Account
Browse files

Stagefright: add a NULL check before accessing camera params

Camera may return NULL params if the remote object is dead.
Check for NULL and report error rather than crash.

Change-Id: Id1fcd04dc187aadf00ca4ec5e48fb495c3369c92
CRs-Fixed: 906099
parent 94be35bc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -113,6 +113,11 @@ void CameraSourceListener::postRecordingFrameHandleTimestamp(nsecs_t timestamp,
}

static int32_t getColorFormat(const char* colorFormat) {
    if (!colorFormat) {
        ALOGE("Invalid color format");
        return -1;
    }

    if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV420P)) {
       return OMX_COLOR_FormatYUV420Planar;
    }