Skip to content

Commit

Permalink
Fix dangling pointer (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
meyraud705 authored Jan 22, 2024
1 parent 9321b24 commit fb501cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmp_core/shaders/bc4_encode_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ int CMP_CDECL CompressBlockBC4S(const char* srcBlock, unsigned int srcStrideInBy
}

CMP_BC15Options* BC15options = (CMP_BC15Options*)options;
CMP_BC15Options BC15optionsDefault;
if (BC15options == NULL)
{
CMP_BC15Options BC15optionsDefault;
BC15options = &BC15optionsDefault;
SetDefaultBC15Options(BC15options);
}
Expand All @@ -241,9 +241,9 @@ int CMP_CDECL DecompressBlockBC4S(const unsigned char cmpBlock[8], CMP_GLOBAL ch
int CMP_CDECL CompressBlockBC4(const unsigned char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[8], const void* options = NULL)
{
CMP_BC15Options* BC15options = (CMP_BC15Options*)options;
CMP_BC15Options BC15optionsDefault;
if (BC15options == NULL)
{
CMP_BC15Options BC15optionsDefault;
BC15options = &BC15optionsDefault;
SetDefaultBC15Options(BC15options);
}
Expand Down

0 comments on commit fb501cc

Please sign in to comment.