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

Commit 34669ce5 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

AMediaFormat_copy: check args

Bug: 111407253
Test: build
Change-Id: I66204937521d0e9d81f0153247ad0984be6e4395
parent 4cc873cc
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -59,6 +59,9 @@ void AMediaFormat_clear(AMediaFormat *format) {


EXPORT
EXPORT
media_status_t AMediaFormat_copy(AMediaFormat *to, AMediaFormat *from) {
media_status_t AMediaFormat_copy(AMediaFormat *to, AMediaFormat *from) {
    if (!to || !from) {
        return AMEDIA_ERROR_INVALID_PARAMETER;
    }
    to->mFormat->clear();
    to->mFormat->clear();
    to->mFormat->extend(from->mFormat);
    to->mFormat->extend(from->mFormat);
    return AMEDIA_OK;
    return AMEDIA_OK;