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

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

Merge "stagefright: null-terminate vendor OMX string extensions" into pi-dev

parents 64da2228 69f360e8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -7615,8 +7615,10 @@ status_t ACodec::setVendorParameters(const sp<AMessage> &params) {
                config->param[paramIndex].bSet =
                    (OMX_BOOL)params->findString(existingKey->second.c_str(), &value);
                if (config->param[paramIndex].bSet) {
                    strncpy((char *)config->param[paramIndex].cString, value.c_str(),
                            sizeof(OMX_CONFIG_ANDROID_VENDOR_PARAMTYPE::cString));
                    size_t dstSize = sizeof(config->param[paramIndex].cString);
                    strncpy((char *)config->param[paramIndex].cString, value.c_str(), dstSize - 1);
                    // null terminate value
                    config->param[paramIndex].cString[dstSize - 1] = '\0';
                }
                break;
            }