Fix #534: Bug in user-defined scaling list
Merge request reports
Activity
This change sets
isAllDefault
to false, if there is one list, that is not equal. So this seems correct.But later we have:
return !isAllDefault;
While the comment says:
"returns true if use default quantization matrix in all size"
So either the return or the comment is wrong.
Btw, I also think
checkDefaultScalingList
is not a good name, because as user of the function I would nor know, what the bool return value is supposed to be. Also the function does not check the default list, it is comparing some input to the default list.isDefaultScalingList
orisEqualToDefaultScalingList
may be better.mentioned in commit 6a160c04
I understand that these messages are correct
Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] 2001 | if( !( !::memcmp(getScalingListAddress(sizeId, listId), getScalingListDefaultAddress(sizeId, listId), sizeof(int)*std::min(MAX_MATRIX_COEF_NUM, (int)g_scalingListSize[sizeId])) // check value of matrix | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=] Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
I use version GCC 9.2.1
http://msystem.waw.pl/x265/mingw-gcc921-20190824.7z
I add open source VVC codec:
Edited by JamaikaMaybe
if ( ::memcmp(getScalingListAddress(sizeId, listId), getScalingListDefaultAddress(sizeId, listId), sizeof(int)*std::min(MAX_MATRIX_COEF_NUM, (int)g_scalingListSize[sizeId])) // check value of matrix && !( (sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == 16) ) ) // check DC value
I have confirmed that your suggestion solves this error without any issues. I have created new merge request as following; !974 (merged)
mentioned in merge request !974 (merged)
mentioned in commit 5fe4d7f5