diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-10-20 22:00:13 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-10-20 22:03:52 +0200 |
| commit | 5d56469f49862026cba3bda7a4a34feca7fe9818 (patch) | |
| tree | 4854f5d69b75d968189e2f8ca8863881bab98df8 | |
| parent | a2c5a7cdc50169992345e5b96d1e3afd6a399c7d (diff) | |
Fix crash when specifying negative crops in the player.
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 1ea88d738..a6ed4e4b9 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -560,10 +560,10 @@ public: int pixels = 0; if (*crop_to_ratio > (2048.0 / 1080.0)) { pixels = (size.height - (size.width / *crop_to_ratio)) / 2; - _film->content()[0]->video->set_crop(Crop{0, 0, pixels, pixels}); + _film->content()[0]->video->set_crop(Crop{0, 0, std::max(0, pixels), std::max(0, pixels)}); } else { pixels = (size.width - (size.height * *crop_to_ratio)) / 2; - _film->content()[0]->video->set_crop(Crop{pixels, pixels, 0, 0}); + _film->content()[0]->video->set_crop(Crop{std::max(0, pixels), std::max(0, pixels), 0, 0}); } } } |
