Skip to content

Commit

Permalink
Fix the 32 bit build regression
Browse files Browse the repository at this point in the history
  • Loading branch information
cqian2 authored and Sherry-Lin committed Sep 27, 2022
1 parent caf9a14 commit e461c05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions media_softlet/agnostic/common/os/mos_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -2841,6 +2841,11 @@ template<class _Ty, class... _Types> inline
_Ty* MosUtilities::MosNewArrayUtil(size_t numElements)
#endif
{
if (numElements > PTRDIFF_MAX)
{
return nullptr;
}

#if (_DEBUG || _RELEASE_INTERNAL)
//Simulate allocate memory fail if flag turned on
if (MosSimulateAllocMemoryFail(sizeof(_Ty) * numElements, NO_ALLOC_ALIGNMENT, functionName, filename, line))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "mos_utilities_specific.h"
#include "mos_utilities.h"
#include "mos_util_debug.h"

#include "inttypes.h"

const char *MosUtilitiesSpecificNext::m_szUserFeatureFile = USER_FEATURE_FILE;
MOS_PUF_KEYLIST MosUtilitiesSpecificNext::m_ufKeyList = nullptr;
Expand Down Expand Up @@ -1020,8 +1020,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpDataToFile(const char *szFil
*(uint32_t*)(pKeyTmp->pElem->pValueArray[j].ulValueBuf));
break;
case UF_QWORD:
fprintf(File, "\t\t\t%lu\n",
*(uint64_t*)(pKeyTmp->pElem->pValueArray[j].ulValueBuf));
fprintf(File, "\t\t\t%" PRIu64"\n", *(uint64_t*)(pKeyTmp->pElem->pValueArray[j].ulValueBuf));
break;
default:
fprintf(File, "\t\t\t%s\n",
Expand Down

0 comments on commit e461c05

Please sign in to comment.