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
5eb295ad
Commit
5eb295ad
authored
Sep 02, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12379 from alalek:fix_warning_win32
parents
af769e4e
20bf7b6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
grfmt_webp.cpp
modules/imgcodecs/src/grfmt_webp.cpp
+1
-1
utils.hpp
modules/imgcodecs/src/utils.hpp
+9
-0
No files found.
modules/imgcodecs/src/grfmt_webp.cpp
View file @
5eb295ad
...
...
@@ -107,7 +107,7 @@ bool WebPDecoder::readHeader()
{
fs
.
open
(
m_filename
.
c_str
(),
std
::
ios
::
binary
);
fs
.
seekg
(
0
,
std
::
ios
::
end
);
fs_size
=
fs
.
tellg
(
);
fs_size
=
safeCastToSizeT
(
fs
.
tellg
(),
"File is too large"
);
fs
.
seekg
(
0
,
std
::
ios
::
beg
);
CV_Assert
(
fs
&&
"File stream error"
);
CV_CheckGE
(
fs_size
,
WEBP_HEADER_SIZE
,
"File is too small"
);
...
...
modules/imgcodecs/src/utils.hpp
View file @
5eb295ad
...
...
@@ -44,6 +44,15 @@
int
validateToInt
(
size_t
step
);
template
<
typename
_Tp
>
static
inline
size_t
safeCastToSizeT
(
const
_Tp
v_origin
,
const
char
*
msg
)
{
const
size_t
value_cast
=
(
size_t
)
v_origin
;
if
((
_Tp
)
value_cast
!=
v_origin
)
CV_Error
(
cv
::
Error
::
StsError
,
msg
?
msg
:
"Can't cast value into size_t"
);
return
value_cast
;
}
struct
PaletteEntry
{
unsigned
char
b
,
g
,
r
,
a
;
...
...
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