Skip to content

Commit

Permalink
Load nvram.vmp only if it has expected size #254
Browse files Browse the repository at this point in the history
  • Loading branch information
izzyreal committed Oct 28, 2024
1 parent e6eefc3 commit 417f4d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/nvram/NvRam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <hardware/Hardware.hpp>
#include <hardware/HwSlider.hpp>

#include <file/all/AllParser.hpp>
#include <file/all/Defaults.hpp>

using namespace mpc::nvram;
Expand All @@ -24,7 +25,8 @@ void NvRam::loadUserScreenValues(mpc::Mpc& mpc)
{
const auto path = mpc.paths->configPath() / "nvram.vmp";

if (!fs::exists(path))
if (!fs::exists(path) ||
fs::file_size(path) != mpc::file::all::AllParser::DEFAULTS_LENGTH)
{
return;
}
Expand Down

0 comments on commit 417f4d3

Please sign in to comment.