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

Commit ab557e2d authored by Shalaj Jain's avatar Shalaj Jain Committed by Ricardo Cerqueira
Browse files

libstagefright: Checking buffer size.

Checking if the allocated buffer size is equal
to the buffer size requested by decoder.

Change-Id: I6e23668b3005badd7748b7687d014854e7152132
parent a972cecf
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2433,6 +2433,15 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
            break;
        }

#ifdef QCOM_CAMERA
	private_handle_t *handle = (private_handle_t *)buf->handle;
        if(!handle) {
                LOGE("Native Buffer handle is NULL");
                break;
        }
        CHECK_EQ(def.nBufferSize, handle->size); //otherwise it might cause memory corruption issues. It may fail because of alignment or extradata.
#endif

        sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(buf, false));
        BufferInfo info;
        info.mData = NULL;