Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c6c584

Browse files
committed
Prevent integer overflow in dimension checks.
This fixeshttps://g-issues.oss-fuzz.com/issues/446726230
1 parentc037344 commit5c6c584

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎modules/imgcodecs/src/grfmt_png.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#include"precomp.hpp"
4444

45+
#include<cstdint>
4546
#include<memory>
4647

4748
#ifdef HAVE_PNG
@@ -364,7 +365,7 @@ bool PngDecoder::readHeader()
364365
m_color_type = color_type;
365366
m_bit_depth = bit_depth;
366367

367-
if (m_is_fcTL_loaded && ((longlongint)x0 + w0 > m_width || (longlongint)y0 + h0 > m_height || dop >2 || bop >1))
368+
if (m_is_fcTL_loaded && ((int64_t)x0 + w0 > m_width || (int64_t)y0 + h0 > m_height || dop >2 || bop >1))
368369
returnfalse;
369370

370371
png_color_16p background_color;
@@ -456,7 +457,7 @@ bool PngDecoder::readData( Mat& img )
456457
if (dop ==2)
457458
memcpy(frameNext.getPixels(), frameCur.getPixels(), imagesize);
458459

459-
if (x0 + w0 > frameCur.getWidth() || y0 + h0 > frameCur.getHeight())
460+
if ((uint64_t)x0 + w0 > frameCur.getWidth() ||(uint64_t)y0 + h0 > frameCur.getHeight())
460461
returnfalse;
461462

462463
compose_frame(frameCur.getRows(), frameRaw.getRows(), bop, x0, y0, w0, h0, mat_cur);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp