Skip to content

Commit

Permalink
fix jpeg issue found by SA
Browse files Browse the repository at this point in the history
  • Loading branch information
finger563 committed Dec 27, 2023
1 parent 749c72b commit 93e38a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions components/jpeg/include/jpeg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ class Jpeg {
imgfile_.open(filename, std::ios::binary | std::ios::ate);
if (!imgfile_.is_open()) {
fmt::print("Couldn't open {}\n", filename);
size = 0;
*size = 0;
return;
}
// get size from current location (end)
// cppcheck-suppress unreadVariable
*size = (size_t)imgfile_.tellg();
// reset file pointer to beginning
imgfile_.seekg(0, std::ios::beg);
Expand Down

0 comments on commit 93e38a2

Please sign in to comment.