diff mbox

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

Message ID 1472541102-37897-1-git-send-email-gbiv@chromium.org
State Superseded
Headers show

Commit Message

George Burgess IV Aug. 30, 2016, 7:11 a.m. UTC
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@chromium.org>
---
 libavutil/opt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Aug. 30, 2016, 10:05 a.m. UTC | #1
On Tue, Aug 30, 2016 at 12:11:42AM -0700, George Burgess IV wrote:
> 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@chromium.org>
> ---
>  libavutil/opt.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

does this patch fix the issue entirely or are there other patches
needed for other files ?
(asking as it seems odd that its just this)


[...]
George Burgess IV Aug. 30, 2016, 10:47 p.m. UTC | #2
[Re-sending from the right email address...]

Good intuition. :) This is all I saw when compiling Chrome; looks like I
misconfigured ffmpeg, though, so `make fate` was using GCC to compile
things. With the correct configuration, I see a few more errors.

I'll send out v2 shortly. Thanks!

On Tue, Aug 30, 2016 at 3:05 AM, Michael Niedermayer <michael@niedermayer.cc
> wrote:

> On Tue, Aug 30, 2016 at 12:11:42AM -0700, George Burgess IV wrote:
> > 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@chromium.org>
> > ---
> >  libavutil/opt.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
>
> does this patch fix the issue entirely or are there other patches
> needed for other files ?
> (asking as it seems odd that its just this)
>
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Observe your enemies, for they first find out your faults. -- Antisthenes
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
diff mbox

Patch

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]);