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

Commit 92dc4546 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

CCodec: Fix null check

'dst' is always non-null, by assumption of the function.  We need
to check if "*dst" is null or not.

We also update the interface definition.

Bug: 197719179
Test: TreeHugger
Change-Id: Ic86891f936f4e84241c55674c1aedcb0d7e15483
parent 92da43cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ bool OutputBuffers::convert(
    if (!srcBuffer) {
        return false;
    }
    if (!dst) {
    if (!*dst) {
        *dst = new Codec2Buffer(
                mFormat,
                new ABuffer(mDataConverter->targetSize(srcBuffer->size())));
+1 −1
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ protected:
    void submit(const sp<MediaCodecBuffer> &buffer);

    /**
     * Apply DataConverter from |src| to |*dst| if needed. If |dst| is nullptr,
     * Apply DataConverter from |src| to |*dst| if needed. If |*dst| is nullptr,
     * a new buffer is allocated.
     *
     * Returns true if conversion was needed and executed; false otherwise.