Issue 195 in ffmbc: FFmbc fails compiling with MinGW GCC 5.2

115 views
Skip to first unread message

ff...@googlecode.com

unread,
Aug 6, 2015, 10:35:33 AM8/6/15
to ffmb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 195 by wiia...@gmail.com: FFmbc fails compiling with MinGW GCC 5.2
https://code.google.com/p/ffmbc/issues/detail?id=195

What steps will reproduce the problem?
1. Use MSYS2 ( http://msys2.github.io/ )
2. Try to compile ffmbc 0.74

What is the expected output? What do you see instead?
`C:/builds/gcc52/msys64/mingw32/i686-w64-mingw32/include/io.h: In
function '_findfirst64i32':
./libavutil/internal.h:148:17: error: implicit declaration of
function 'strncpy_is_forbidden_due_to_security_issues_use_av_strlcpy'
[-Werror=implicit-function-declaration]
#define strncpy strncpy_is_forbidden_due_to_security_issues_use_av_strlcpy
^
cc1.exe: some warnings being treated as errors`

What version of the product are you using? On what operating system?
MSYS2/MinGW GCC 5.2 with Windows 8.1 64-bits

Please provide any additional information below:
configure log:
https://gist.github.com/wiiaboo/ac0e852c91d89327a9c0#file-configure-log
make log: https://gist.github.com/wiiaboo/ac0e852c91d89327a9c0#file-make-log


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Mark Himsley

unread,
May 30, 2017, 3:29:16 PM5/30/17
to ffmbc-dev, codesite...@google.com, ff...@googlecode.com
This happens when building with version 3.1.0 mingw-w64 on Ubuntu 16.04, but not with the version of mingw-w64 that came with Ubuntu 14.04. 

The simplest fix is to apply this:

diff --git a/libavutil/internal.h b/libavutil/internal.h
index a7fe6c8..64d09f4 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -144,8 +144,6 @@
 #define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf
 #undef  strcat
 #define strcat strcat_is_forbidden_due_to_security_issues_use_av_strlcat
-#undef  strncpy
-#define strncpy strncpy_is_forbidden_due_to_security_issues_use_av_strlcpy
 #undef  exit
 #define exit exit_is_forbidden
 #undef  printf

But the best fix that I've seen is to apply commit e96d90eed66a198566c409958432d282e1b03869 from FFmpeg, author: Janne Grunau <janne...@jannau.net> 2012-10-26 19:26:29. I think the comment on that commit explains it all.

Mark Himsley

unread,
May 31, 2017, 11:32:13 AM5/31/17
to ffmbc-dev, codesite...@google.com, ff...@googlecode.com
Oops - if you apply commit e96d90eed66a198566c409958432d282e1b03869 from FFmpeg then you need to remove some work-arounds from FFmbc.

There's this patch, which is required or compilation fails:

diff --git a/libavfilter/vf_mp.c b/libavfilter/vf_mp.c
index 9d1de2b..af3e712 100644
--- a/libavfilter/vf_mp.c
+++ b/libavfilter/vf_mp.c
@@ -619,7 +619,7 @@
         goto fail;
 
     picref->buf = pic;
-    picref->buf->please_use_av_free= av_free;
+    picref->buf->free= av_free;
     if (!(picref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps))))
         goto fail;

and this patch which is just a workaround that is best removed:

diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c
index 2a8e9d2..383599e 100644
--- a/libavcodec/libfaac.c
+++ b/libavcodec/libfaac.c
@@ -116,9 +116,7 @@
             memcpy(avctx->extradata, buffer, avctx->extradata_size);
             faac_cfg->outputFormat = 0;
         }
-#undef free
         free(buffer);
-#define free please_use_av_free
     }
 
     if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
Reply all
Reply to author
Forward
0 new messages