summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2013-10-26 19:36:03 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2013-10-26 19:49:04 (GMT)
commit3fcc2684e49bbaa5a92a768f7649584e1d982f9f (patch)
tree637248bf8c8017a0fddc366d1faef37a2f9f670f
parentd2db1bb7dea19551e4604067d0acbd9e2950c698 (diff)
parentb284e1ffe343d6697fb950d1ee517bafda8a9844 (diff)
downloadffmpeg-3fcc2684e49bbaa5a92a768f7649584e1d982f9f.zip
ffmpeg-3fcc2684e49bbaa5a92a768f7649584e1d982f9f.tar.gz
ffmpeg-3fcc2684e49bbaa5a92a768f7649584e1d982f9f.tar.bz2
Merge commit 'b284e1ffe343d6697fb950d1ee517bafda8a9844'
* commit 'b284e1ffe343d6697fb950d1ee517bafda8a9844': mem: do not check for negative size Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--libavutil/mem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h
index b73b724..77b7adc 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -92,7 +92,7 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
*/
av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (!size || nmemb >= INT_MAX / size)
return NULL;
return av_malloc(nmemb * size);
}
@@ -227,7 +227,7 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
*/
av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
{
- if (size <= 0 || nmemb >= INT_MAX / size)
+ if (!size || nmemb >= INT_MAX / size)
return NULL;
return av_mallocz(nmemb * size);
}