Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
7bff3378
Commit
7bff3378
authored
Oct 20, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3350 from Trundle:fix_some_tiff_crashes
parents
263621ae
24580e34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
grfmt_tiff.cpp
modules/highgui/src/grfmt_tiff.cpp
+6
-5
test_grfmt.cpp
modules/highgui/test/test_grfmt.cpp
+1
-1
No files found.
modules/highgui/src/grfmt_tiff.cpp
View file @
7bff3378
...
...
@@ -214,7 +214,8 @@ bool TiffDecoder::readData( Mat& img )
(
!
is_tiled
&&
tile_height0
==
std
::
numeric_limits
<
uint32
>::
max
())
)
tile_height0
=
m_height
;
AutoBuffer
<
uchar
>
_buffer
(
size_t
(
8
)
*
tile_height0
*
tile_width0
);
const
size_t
buffer_size
=
bpp
*
ncn
*
tile_height0
*
tile_width0
;
AutoBuffer
<
uchar
>
_buffer
(
buffer_size
);
uchar
*
buffer
=
_buffer
;
ushort
*
buffer16
=
(
ushort
*
)
buffer
;
float
*
buffer32
=
(
float
*
)
buffer
;
...
...
@@ -269,9 +270,9 @@ bool TiffDecoder::readData( Mat& img )
case
16
:
{
if
(
!
is_tiled
)
ok
=
(
int
)
TIFFReadEncodedStrip
(
tif
,
tileidx
,
(
uint32
*
)
buffer
,
(
tsize_t
)
-
1
)
>=
0
;
ok
=
(
int
)
TIFFReadEncodedStrip
(
tif
,
tileidx
,
(
uint32
*
)
buffer
,
buffer_size
)
>=
0
;
else
ok
=
(
int
)
TIFFReadEncodedTile
(
tif
,
tileidx
,
(
uint32
*
)
buffer
,
(
tsize_t
)
-
1
)
>=
0
;
ok
=
(
int
)
TIFFReadEncodedTile
(
tif
,
tileidx
,
(
uint32
*
)
buffer
,
buffer_size
)
>=
0
;
if
(
!
ok
)
{
...
...
@@ -325,9 +326,9 @@ bool TiffDecoder::readData( Mat& img )
case
64
:
{
if
(
!
is_tiled
)
ok
=
(
int
)
TIFFReadEncodedStrip
(
tif
,
tileidx
,
buffer
,
(
tsize_t
)
-
1
)
>=
0
;
ok
=
(
int
)
TIFFReadEncodedStrip
(
tif
,
tileidx
,
buffer
,
buffer_size
)
>=
0
;
else
ok
=
(
int
)
TIFFReadEncodedTile
(
tif
,
tileidx
,
buffer
,
(
tsize_t
)
-
1
)
>=
0
;
ok
=
(
int
)
TIFFReadEncodedTile
(
tif
,
tileidx
,
buffer
,
buffer_size
)
>=
0
;
if
(
!
ok
||
ncn
!=
1
)
{
...
...
modules/highgui/test/test_grfmt.cpp
View file @
7bff3378
...
...
@@ -516,7 +516,7 @@ TEST(Highgui_Tiff, decode_tile_remainder)
CV_GrfmtReadTifTiledWithNotFullTiles
test
;
test
.
safe_run
();
}
TEST
(
Imgcodecs
_Tiff
,
decode_infinite_rowsperstrip
)
TEST
(
Highgui
_Tiff
,
decode_infinite_rowsperstrip
)
{
const
uchar
sample_data
[
142
]
=
{
0x49
,
0x49
,
0x2a
,
0x00
,
0x10
,
0x00
,
0x00
,
0x00
,
0x56
,
0x54
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment