Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
digiKam
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Peter Becker
digiKam
Commits
6eb5baec
Commit
6eb5baec
authored
May 11, 2020
by
Maik Qualmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
polish
parent
d9167290
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
core/libs/dimg/loaders/dimgloader.h
core/libs/dimg/loaders/dimgloader.h
+4
-4
No files found.
core/libs/dimg/loaders/dimgloader.h
View file @
6eb5baec
...
...
@@ -103,7 +103,7 @@ public:
static
qint64
checkAllocation
(
qint64
fullSize
);
template
<
typename
Type
>
static
Type
*
new_failureTolerant
(
size_t
unsecureSize
);
template
<
typename
Type
>
static
Type
*
new_failureTolerant
(
quint64
w
,
quint64
h
,
uint
typesPerPixel
);
template
<
typename
Type
>
static
Type
*
new_failureTolerant
(
uint
w
,
uint
h
,
uint
typesPerPixel
);
protected:
...
...
@@ -156,14 +156,14 @@ private:
* 32bit overflow and exceeding the size_t type
*/
template
<
typename
Type
>
Q_INLINE_TEMPLATE
Type
*
DImgLoader
::
new_failureTolerant
(
quint64
w
,
quint64
h
,
uint
typesPerPixel
)
Q_INLINE_TEMPLATE
Type
*
DImgLoader
::
new_failureTolerant
(
uint
w
,
uint
h
,
uint
typesPerPixel
)
{
quint64
requested
=
w
*
h
*
quint64
(
typesPerPixel
)
;
quint64
requested
=
(
quint64
)
w
*
(
quint64
)
h
*
(
quint64
)
typesPerPixel
;
quint64
maximum
=
std
::
numeric_limits
<
size_t
>::
max
();
if
(
requested
>
maximum
)
{
qCCritical
(
DIGIKAM_DIMG_LOG
)
<<
"Requested memory of"
<<
requested
*
quint64
(
sizeof
(
Type
))
qCCritical
(
DIGIKAM_DIMG_LOG
)
<<
"Requested memory of"
<<
requested
*
quint64
(
sizeof
(
Type
))
<<
"is larger than size_t supported by platform."
;
return
nullptr
;
}
...
...
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