Commit 8da0e27d by olly Committed by Oliver Woodman

Fix premature nullness assertions

Issue: #6910
PiperOrigin-RevId: 291721229
parent 4dddad83
...@@ -560,28 +560,32 @@ public final class H264Reader implements ElementaryStreamReader { ...@@ -560,28 +560,32 @@ public final class H264Reader implements ElementaryStreamReader {
} }
private boolean isFirstVclNalUnitOfPicture(SliceHeaderData other) { private boolean isFirstVclNalUnitOfPicture(SliceHeaderData other) {
if (!isComplete) {
return false;
}
if (!other.isComplete) {
return true;
}
// See ISO 14496-10 subsection 7.4.1.2.4. // See ISO 14496-10 subsection 7.4.1.2.4.
SpsData spsData = Assertions.checkStateNotNull(this.spsData); SpsData spsData = Assertions.checkStateNotNull(this.spsData);
SpsData otherSpsData = Assertions.checkStateNotNull(other.spsData); SpsData otherSpsData = Assertions.checkStateNotNull(other.spsData);
return isComplete return frameNum != other.frameNum
&& (!other.isComplete || picParameterSetId != other.picParameterSetId
|| frameNum != other.frameNum || fieldPicFlag != other.fieldPicFlag
|| picParameterSetId != other.picParameterSetId || (bottomFieldFlagPresent
|| fieldPicFlag != other.fieldPicFlag && other.bottomFieldFlagPresent
|| (bottomFieldFlagPresent && bottomFieldFlag != other.bottomFieldFlag)
&& other.bottomFieldFlagPresent || (nalRefIdc != other.nalRefIdc && (nalRefIdc == 0 || other.nalRefIdc == 0))
&& bottomFieldFlag != other.bottomFieldFlag) || (spsData.picOrderCountType == 0
|| (nalRefIdc != other.nalRefIdc && (nalRefIdc == 0 || other.nalRefIdc == 0)) && otherSpsData.picOrderCountType == 0
|| (spsData.picOrderCountType == 0 && (picOrderCntLsb != other.picOrderCntLsb
&& otherSpsData.picOrderCountType == 0 || deltaPicOrderCntBottom != other.deltaPicOrderCntBottom))
&& (picOrderCntLsb != other.picOrderCntLsb || (spsData.picOrderCountType == 1
|| deltaPicOrderCntBottom != other.deltaPicOrderCntBottom)) && otherSpsData.picOrderCountType == 1
|| (spsData.picOrderCountType == 1 && (deltaPicOrderCnt0 != other.deltaPicOrderCnt0
&& otherSpsData.picOrderCountType == 1 || deltaPicOrderCnt1 != other.deltaPicOrderCnt1))
&& (deltaPicOrderCnt0 != other.deltaPicOrderCnt0 || idrPicFlag != other.idrPicFlag
|| deltaPicOrderCnt1 != other.deltaPicOrderCnt1)) || (idrPicFlag && idrPicId != other.idrPicId);
|| idrPicFlag != other.idrPicFlag
|| (idrPicFlag && idrPicId != other.idrPicId));
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment