Permalink
Browse files

Merge pull request #11330 from unknownbrackets/mac-realpath

Use a larger buffer for realpath()
  • Loading branch information...
hrydgard committed Aug 26, 2018
2 parents 4cb230d + 274b1ea commit 773dba1be2b92560140429803d638cf1f82a2fa4
Showing with 6 additions and 4 deletions.
  1. +5 −3 Common/FileUtil.cpp
  2. +1 −1 GPU/Common/GPUStateUtils.cpp
View
@@ -24,6 +24,7 @@
#include "ppsspp_config.h"
#include <memory>
#include "FileUtil.h"
#include "StringUtils.h"
@@ -152,11 +153,12 @@ std::string ResolvePath(const std::string &path) {
output = output.substr(4);
delete [] buf;
return output;
#else
char buf[PATH_MAX + 1];
if (realpath(path.c_str(), buf) == nullptr)
std::unique_ptr<char[]> buf(new char[PATH_MAX + 32768]);
if (realpath(path.c_str(), buf.get()) == nullptr)
return path;
return buf;
return buf.get();
#endif
}
@@ -48,7 +48,7 @@ bool NeedsTestDiscard() {
return true;
if (!gstate.isAlphaBlendEnabled())
return true;
if (gstate.getBlendFuncA() != GE_SRCBLEND_SRCALPHA && gstate.getBlendFuncA() != GE_DSTBLEND_DOUBLESRCALPHA)
if (gstate.getBlendFuncA() != GE_SRCBLEND_SRCALPHA && gstate.getBlendFuncA() != GE_SRCBLEND_DOUBLESRCALPHA)
return true;
// GE_DSTBLEND_DOUBLEINVSRCALPHA is actually inverse double src alpha, and doubling zero is still zero.
if (gstate.getBlendFuncB() != GE_DSTBLEND_INVSRCALPHA && gstate.getBlendFuncB() != GE_DSTBLEND_DOUBLEINVSRCALPHA) {

0 comments on commit 773dba1

Please sign in to comment.