Bug 1788192. Deal with frame/image size overflow and handle it gracefully in border code. r=nical

imgDimension comes directly from the size of the frame, which has overflowed into the negatives. The code wants value to be positive but hasn't considered that imgDimension can be negative.

Differential Revision: https://phabricator.services.mozilla.com/D159138
This commit is contained in:
Timothy Nikkel 2022-10-18 19:57:57 +00:00
Родитель 47ab4d168f
Коммит ce8b367250
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -3845,7 +3845,7 @@ nsCSSBorderImageRenderer::nsCSSBorderImageRenderer(
if (value < 0) {
value = 0;
}
if (value > imgDimension) {
if (value > imgDimension && imgDimension > 0) {
value = imgDimension;
}
mSlice.Side(s) = value;