diff --git a/source/Lib/CommonLib/PicYuvMD5.cpp b/source/Lib/CommonLib/PicYuvMD5.cpp index d8d6687f27ff54a696a1519a5fc77727322f8f2f..8c13bd7bcd5315b2cdf43dafe6ee834c8402ee1a 100644 --- a/source/Lib/CommonLib/PicYuvMD5.cpp +++ b/source/Lib/CommonLib/PicYuvMD5.cpp @@ -253,6 +253,9 @@ int calcAndPrintHashStatus(const CPelUnitBuf& pic, const SEIDecodedPictureHash* if (pictureHashSEI) { +#if FIX_TICKET_1405 + CHECK ((uint32_t)pic.bufs.size() != ( pictureHashSEI->singleCompFlag ? 1 : 3 ), "The value of dph_sei_single_component_flag shall be equal to (ChromaFormatIdc == 0)."); +#endif switch (pictureHashSEI->method) { case HASHTYPE_MD5: diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index 3365df9394b5e3c69c87fe71883c248322fc1b9d..a09a2125e91f9af4e408ff4f38ac2919c5858dc1 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -445,6 +445,8 @@ void SEIReader::xParseSEIDecodedPictureHash(SEIDecodedPictureHash& sei, uint32_t sei.singleCompFlag = val; sei_read_code( pDecodedMessageOutputStream, 7, val, "dph_sei_reserved_zero_7bits"); bytesRead++; + uint32_t expectedSize = ( sei.singleCompFlag ? 1 : 3 ) * (sei.method == 0 ? 16 : (sei.method == 1 ? 2 : 4)); + CHECK ((payloadSize - bytesRead) != expectedSize, "The size of the decoded picture hash does not match the expected size."); #endif const char *traceString="\0";