scratch: add quick validity check

fix github issue #350
This commit is contained in:
Hong, Yang A
2022-10-20 08:48:46 +00:00
committed by Konstantinos Margaritis
parent 87f9ecb402
commit 3a56b1b787
5 changed files with 28 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Intel Corporation
* Copyright (c) 2015-2022, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -57,6 +57,9 @@ struct hs_stream {
/** \brief The current stream offset. */
u64a offset;
/** \brief Identity of hs_stream, for scratch validity check. */
u32 crc32;
};
#define getMultiState(hs_s) ((char *)(hs_s) + sizeof(*(hs_s)))