Merge pull request #15836 from unknownbrackets/headless

Correct a couple more Valgrind warnings in HLE
This commit is contained in:
Henrik Rydgård 2022-08-13 18:36:39 +02:00 committed by GitHub
commit 4d096925fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -619,10 +619,12 @@ struct Atrac {
void ConsumeFrame() {
bufferPos_ += bytesPerFrame_;
if (bufferValidBytes_ > bytesPerFrame_) {
bufferValidBytes_ -= bytesPerFrame_;
} else {
bufferValidBytes_ = 0;
if ((bufferState_ & ATRAC_STATUS_STREAMED_MASK) == ATRAC_STATUS_STREAMED_MASK) {
if (bufferValidBytes_ > bytesPerFrame_) {
bufferValidBytes_ -= bytesPerFrame_;
} else {
bufferValidBytes_ = 0;
}
}
if (bufferPos_ >= StreamBufferEnd()) {
// Wrap around... theoretically, this should only happen at exactly StreamBufferEnd.

View File

@ -486,8 +486,7 @@ public:
// For save states only.
}
FontLib(u32 paramPtr, u32 errorCodePtr) : fontHRes_(128.0f), fontVRes_(128.0f), altCharCode_(0x5F), charInfoBitmapAddress_(0) {
nfl_ = 0;
FontLib(u32 paramPtr, u32 errorCodePtr) {
Memory::ReadStruct(paramPtr, &params_);
if (params_.numFonts > 9) {
params_.numFonts = 9;
@ -753,14 +752,14 @@ private:
std::vector<u32> fontRefCount_;
FontNewLibParams params_;
float fontHRes_;
float fontVRes_;
int fileFontHandle_;
int handle_;
int altCharCode_;
float fontHRes_ = 128.0f;
float fontVRes_ = 128.0f;
int fileFontHandle_ = -1;
int handle_ = -1;
int altCharCode_ = 0x5F;
std::vector<u32> openAllocatedAddresses_;
u32 charInfoBitmapAddress_;
PSPPointer<NativeFontLib> nfl_;
u32 charInfoBitmapAddress_ = 0;
PSPPointer<NativeFontLib> nfl_{};
DISALLOW_COPY_AND_ASSIGN(FontLib);
};