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

Commit 7e8b1832 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AMediaFormat_copy: check args"

parents 4737a7ed 34669ce5
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;