mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 15:34:01 +00:00
Bug 1604497 - Avoid division by zero in I420Buffer::CropAndScaleFrom; r=ng
Differential Revision: https://phabricator.services.mozilla.com/D58150 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2f2d1f7fc1
commit
fad95a456d
@ -221,10 +221,10 @@ void I420Buffer::CropAndScaleFrom(const I420BufferInterface& src,
|
||||
}
|
||||
|
||||
void I420Buffer::CropAndScaleFrom(const I420BufferInterface& src) {
|
||||
const int crop_width =
|
||||
std::min(src.width(), width() * src.height() / height());
|
||||
const int crop_height =
|
||||
std::min(src.height(), height() * src.width() / width());
|
||||
const int crop_width = height() ?
|
||||
std::min(src.width(), width() * src.height() / height()) : src.width();
|
||||
const int crop_height = width() ?
|
||||
std::min(src.height(), height() * src.width() / width()) : src.height();
|
||||
|
||||
CropAndScaleFrom(
|
||||
src,
|
||||
|
Loading…
x
Reference in New Issue
Block a user