projects
/
openjpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aae066d
)
Update implementation of opj_calloc (#705)
author
Stefan Weil
<sw@weilnetz.de>
Tue, 10 May 2016 20:08:49 +0000
(22:08 +0200)
committer
Matthieu Darbois
<mayeut@users.noreply.github.com>
Tue, 10 May 2016 20:08:49 +0000
(22:08 +0200)
src/lib/openjp2/opj_malloc.c
patch
|
blob
|
history
diff --git
a/src/lib/openjp2/opj_malloc.c
b/src/lib/openjp2/opj_malloc.c
index e04db912b88b941f1d701283916e278a94e1ce71..4f8b1d6f77fc40717922e2fa8baad0e54aef5f20 100644
(file)
--- a/
src/lib/openjp2/opj_malloc.c
+++ b/
src/lib/openjp2/opj_malloc.c
@@
-196,10
+196,10
@@
void * opj_malloc(size_t size)
}
void * opj_calloc(size_t num, size_t size)
{
- if (size == 0U) { /* prevent implementation defined behavior of realloc */
+ if (num == 0 || size == 0) {
+ /* prevent implementation defined behavior of realloc */
return NULL;
}
- /* according to C89 standard, num == 0 shall return a valid pointer */
return calloc(num, size);
}