aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Harris <mark.hsj@gmail.com>2018-11-24 13:02:02 -0800
committerJames Almer <jamrial@gmail.com>2019-07-23 01:21:55 -0300
commit266b784bb3698120dfea9de6dce562df9bebd845 (patch)
tree94f80364e8b301809c7cfca30722a2bb0f8ce8b0
parent88588a24e9153ca2410e970990fa2acacaa8b2cc (diff)
downloadffmpeg-266b784bb3698120dfea9de6dce562df9bebd845.tar.gz
avutil/mem: Fix invalid use of av_alloc_size
The alloc_size attribute is valid only on functions that return a pointer. GCC 9 (not yet released) warns about invalid usage: ./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes] 342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); | ^~~~~~~~~~~~~ Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4361293fcf59edb56879c36edcd25f0a91e0edf8)
-rw-r--r--libavutil/mem.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h
index 2a1e36d69f..83b714618b 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -182,7 +182,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
* The situation is undefined according to POSIX and may crash with
* some libc implementations.
*/
-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
/**
* Free a memory block which has been allocated with av_malloc(z)() or