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

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

Merge "Handle portId out of bounds index"

parents 207f2380 588b958c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -278,6 +278,10 @@ Return<void> HdmiCecDefault::enableAudioReturnChannel(int32_t /*portId*/, bool /

Return<bool> HdmiCecDefault::isConnected(int32_t portId) {
    uint16_t addr;
    if (portId < 0 || portId >= mHdmiCecPorts.size()) {
        LOG(ERROR) << "Port id is out of bounds, portId = " << portId;
        return false;
    }
    int ret = ioctl(mHdmiCecPorts[portId]->mCecFd, CEC_ADAP_G_PHYS_ADDR, &addr);
    if (ret) {
        LOG(ERROR) << "Is connected failed, Error = " << strerror(errno);