mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 12:19:50 +01:00
png: add setjmp() to detect libpng internal error
This commit is contained in:
parent
6d889ee74c
commit
d9572861d1
|
|
@ -434,6 +434,9 @@ bool PngDecoder::readData( Mat& img )
|
|||
if (!processing_start((void*)&frameRaw, mat_cur))
|
||||
return false;
|
||||
|
||||
// See https://github.com/opencv/opencv/issues/27744
|
||||
if( setjmp( png_jmpbuf ( m_png_ptr ) ) == 0 )
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
id = read_chunk(chunk);
|
||||
|
|
@ -567,6 +570,12 @@ bool PngDecoder::readData( Mat& img )
|
|||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// libpng internal error is detected.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
volatile bool result = false;
|
||||
bool color = img.channels() > 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user