Line 0
Link Here
|
|
|
1 |
From 4361293fcf59edb56879c36edcd25f0a91e0edf8 Mon Sep 17 00:00:00 2001 |
2 |
From: Mark Harris <mark.hsj@gmail.com> |
3 |
Date: Sat, 24 Nov 2018 13:02:02 -0800 |
4 |
Subject: [PATCH] avutil/mem: Fix invalid use of av_alloc_size |
5 |
|
6 |
The alloc_size attribute is valid only on functions that return a |
7 |
pointer. GCC 9 (not yet released) warns about invalid usage: |
8 |
|
9 |
./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes] |
10 |
342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); |
11 |
| ^~~~~~~~~~~~~ |
12 |
|
13 |
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
14 |
--- |
15 |
libavutil/mem.h | 2 +- |
16 |
1 file changed, 1 insertion(+), 1 deletion(-) |
17 |
|
18 |
diff --git libavutil/mem.h libavutil/mem.h |
19 |
index 55ae573ac9a..5fb1a02dd9c 100644 |
20 |
--- libavutil/mem.h |
21 |
+++ libavutil/mem.h |
22 |
@@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size) |
23 |
* @warning Unlike av_malloc(), the allocated memory is not guaranteed to be |
24 |
* correctly aligned. |
25 |
*/ |
26 |
-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); |
27 |
+int av_reallocp_array(void *ptr, size_t nmemb, size_t size); |
28 |
|
29 |
/** |
30 |
* Reallocate the given buffer if it is not large enough, otherwise do nothing. |