1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Fix potential overflow

Fixes https://g-issues.oss-fuzz.com/issues/470321412
This commit is contained in:
Vincent Rabaud
2025-12-19 16:59:18 +01:00
parent 9f9b6e8dd3
commit 5d8ab389f8
+1 -1
View File
@@ -509,7 +509,7 @@ bool PngDecoder::readData( Mat& img )
dop = chunk.p[32];
bop = chunk.p[33];
if (int(x0 + w0) > img.cols || int(y0 + h0) > img.rows || dop > 2 || bop > 1)
if ((int64_t)x0 + w0 > img.cols || (int64_t)y0 + h0 > img.rows || dop > 2 || bop > 1)
{
return false;
}