Skip to content

Commit

Permalink
copy_to_buffer return right away if range empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Oz Amram committed Sep 14, 2021
1 parent fd2a236 commit ffdea77
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ void PixelThresholdClusterizer::copy_to_buffer(DigiIterator begin, DigiIterator
// std::cout << (doMissCalibrate ? "VI from db" : "VI linear") << std::endl;
}
#endif

//avoid undefined behavior
if (end <= begin)
return;

int electron[end - begin]; // pixel charge in electrons
memset(electron, 0, (end - begin) * sizeof(int));

Expand Down

0 comments on commit ffdea77

Please sign in to comment.