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 {
}
private boolean isFirstVclNalUnitOfPicture(SliceHeaderData other) {
if (!isComplete) {
return false;
}
if (!other.isComplete) {
return true;
}
// See ISO 14496-10 subsection 7.4.1.2.4.
SpsData spsData = Assertions.checkStateNotNull(this.spsData);
SpsData otherSpsData = Assertions.checkStateNotNull(other.spsData);
return isComplete
&& (!other.isComplete
|| frameNum != other.frameNum
|| picParameterSetId != other.picParameterSetId
|| fieldPicFlag != other.fieldPicFlag
|| (bottomFieldFlagPresent
&& other.bottomFieldFlagPresent
&& bottomFieldFlag != other.bottomFieldFlag)
|| (nalRefIdc != other.nalRefIdc && (nalRefIdc == 0 || other.nalRefIdc == 0))
|| (spsData.picOrderCountType == 0
&& otherSpsData.picOrderCountType == 0
&& (picOrderCntLsb != other.picOrderCntLsb
|| deltaPicOrderCntBottom != other.deltaPicOrderCntBottom))
|| (spsData.picOrderCountType == 1
&& otherSpsData.picOrderCountType == 1
&& (deltaPicOrderCnt0 != other.deltaPicOrderCnt0
|| deltaPicOrderCnt1 != other.deltaPicOrderCnt1))
|| idrPicFlag != other.idrPicFlag
|| (idrPicFlag && idrPicId != other.idrPicId));
return frameNum != other.frameNum
|| picParameterSetId != other.picParameterSetId
|| fieldPicFlag != other.fieldPicFlag
|| (bottomFieldFlagPresent
&& other.bottomFieldFlagPresent
&& bottomFieldFlag != other.bottomFieldFlag)
|| (nalRefIdc != other.nalRefIdc && (nalRefIdc == 0 || other.nalRefIdc == 0))
|| (spsData.picOrderCountType == 0
&& otherSpsData.picOrderCountType == 0
&& (picOrderCntLsb != other.picOrderCntLsb
|| deltaPicOrderCntBottom != other.deltaPicOrderCntBottom))
|| (spsData.picOrderCountType == 1
&& otherSpsData.picOrderCountType == 1
&& (deltaPicOrderCnt0 != other.deltaPicOrderCnt0
|| deltaPicOrderCnt1 != other.deltaPicOrderCnt1))
|| 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