diff --git a/packager/app/test/testdata/bear-640x360-hevc-v-cenc-golden.mp4 b/packager/app/test/testdata/bear-640x360-hevc-v-cenc-golden.mp4 index 49051edf81..fef674ed99 100644 Binary files a/packager/app/test/testdata/bear-640x360-hevc-v-cenc-golden.mp4 and b/packager/app/test/testdata/bear-640x360-hevc-v-cenc-golden.mp4 differ diff --git a/packager/media/formats/mp4/encrypting_fragmenter.cc b/packager/media/formats/mp4/encrypting_fragmenter.cc index 1138da290b..0abfa2cde0 100644 --- a/packager/media/formats/mp4/encrypting_fragmenter.cc +++ b/packager/media/formats/mp4/encrypting_fragmenter.cc @@ -257,7 +257,8 @@ Status EncryptingFragmenter::EncryptSample(scoped_refptr sample) { accumulated_clear_bytes = 0; } else { // For non-video-slice NAL units, don't encrypt. - accumulated_clear_bytes += nalu.header_size() + nalu.payload_size(); + accumulated_clear_bytes += + nalu_length_size_ + nalu.header_size() + nalu.payload_size(); } } if (result != NaluReader::kEOStream)