Skip to content

Commit

Permalink
More paranoia
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 31, 2024
1 parent 65bfdb1 commit ce5f157
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
20 changes: 10 additions & 10 deletions Core/FileSystems/BlockDevices.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ class CISOFileBlockDevice : public BlockDevice {
bool IsDisc() const override { return true; }

private:
u32 *index;
u8 *readBuffer;
u8 *zlibBuffer;
u32 zlibBufferFrame;
u8 indexShift;
u8 blockShift;
u32 frameSize;
u32 numBlocks;
u32 numFrames;
int ver_;
u32 *index = nullptr;
u8 *readBuffer = nullptr;
u8 *zlibBuffer = nullptr;
u32 zlibBufferFrame = 0;
u8 indexShift = 0;
u8 blockShift = 0;
u32 frameSize = 0;
u32 numBlocks = 0;
u32 numFrames = 0;
int ver_ = 0;
};


Expand Down
5 changes: 4 additions & 1 deletion Core/HLE/sceAtrac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,10 @@ int Atrac::Analyze(u32 addr, u32 size) {
}
int checkNumLoops = Memory::Read_U32(first_.addr + offset + 28);
if (checkNumLoops != 0 && chunkSize < 36 + 20) {
return hleReportError(ME, ATRAC_ERROR_UNKNOWN_FORMAT, "smpl chunk too small for loop (%d)", chunkSize);
return hleReportError(ME, ATRAC_ERROR_UNKNOWN_FORMAT, "smpl chunk too small for loop (%d, %d)", checkNumLoops, chunkSize);
}
if (checkNumLoops < 0) {
return hleReportError(ME, ATRAC_ERROR_UNKNOWN_FORMAT, "bad checkNumLoops (%d)", checkNumLoops);
}

loopinfo_.resize(checkNumLoops);
Expand Down
2 changes: 1 addition & 1 deletion Core/HW/SasAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class SasInstance {
private:
SasReverb reverb_;
int grainSize = 0;
int16_t mixTemp_[PSP_SAS_MAX_GRAIN * 4 + 2 + 8]; // some extra margin for very high pitches.
int16_t mixTemp_[PSP_SAS_MAX_GRAIN * 4 + 2 + 16]; // some extra margin for very high pitches.
};

const char *ADSRCurveModeAsString(SasADSRCurveMode mode);
10 changes: 6 additions & 4 deletions UI/MiscScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,10 +1057,12 @@ void SettingInfoMessage::Show(const std::string &text, const UI::View *refView)
if (refView) {
Bounds b = refView->GetBounds();
const UI::AnchorLayoutParams *lp = GetLayoutParams()->As<UI::AnchorLayoutParams>();
if (cutOffY_ != -1.0f && b.y >= cutOffY_) {
ReplaceLayoutParams(new UI::AnchorLayoutParams(lp->width, lp->height, lp->left, 80.0f, lp->right, lp->bottom, lp->center));
} else {
ReplaceLayoutParams(new UI::AnchorLayoutParams(lp->width, lp->height, lp->left, g_display.dp_yres - 80.0f - 40.0f, lp->right, lp->bottom, lp->center));
if (lp) {
if (cutOffY_ != -1.0f && b.y >= cutOffY_) {
ReplaceLayoutParams(new UI::AnchorLayoutParams(lp->width, lp->height, lp->left, 80.0f, lp->right, lp->bottom, lp->center));
} else {
ReplaceLayoutParams(new UI::AnchorLayoutParams(lp->width, lp->height, lp->left, g_display.dp_yres - 80.0f - 40.0f, lp->right, lp->bottom, lp->center));
}
}
}
text_->SetText(text);
Expand Down

0 comments on commit ce5f157

Please sign in to comment.