[FFmpeg-devel] [PATCH] libavutil: let clang-FORTIFY build; NFC.

George Burgess IV gbiv at chromium.org
Tue Aug 30 10:11:42 EEST 2016


ChromeOS is adopting a new FORTIFY implementation tailored for clang. As
an artifact of how this new FORTIFY is implemented, a handful of
implicit conversion warnings get turned into errors. This patch fixes
the implicit conversions in ffmpeg that clang-FORTIFY has an issue with.

Signed-off-by: George Burgess IV <gbiv at chromium.org>
---
 libavutil/opt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index cd16bd1..f7f5225 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -733,7 +733,8 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
 {
     void *dst, *target_obj;
     const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
-    uint8_t *bin, buf[128];
+    uint8_t *bin;
+    char buf[128];
     int len, i, ret;
     int64_t i64;
 
@@ -795,7 +796,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
         }
         bin = *(uint8_t **)dst;
         for (i = 0; i < len; i++)
-            snprintf(*out_val + i * 2, 3, "%02X", bin[i]);
+            snprintf(*(char **)out_val + i * 2, 3, "%02X", bin[i]);
         return 0;
     case AV_OPT_TYPE_IMAGE_SIZE:
         ret = snprintf(buf, sizeof(buf), "%dx%d", ((int *)dst)[0], ((int *)dst)[1]);
-- 
2.8.0.rc3.226.g39d4020



More information about the ffmpeg-devel mailing list