summaryrefslogtreecommitdiff
path: root/libavutil/log.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-06-17 10:31:11 +0300
committerMartin Storsjö <martin@martin.st>2011-06-23 20:17:46 +0300
commit9abbe8cc136e7fbc69004df3f1de9d54c40d969d (patch)
treeeaa9dcee4f92e3a4cfb0911d4cd1eb6a0ae92813 /libavutil/log.h
parent67e9ae14d93aeee019bf65d38192ca5c75dc99dd (diff)
Use av_printf_format to check the usage of printf style functions
This helps catching cases where the format string doesn't match what is passed in, or injection bugs where user data is passed in as format string. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/log.h')
-rw-r--r--libavutil/log.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavutil/log.h b/libavutil/log.h
index c823a763ee..c1d9a6c393 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -23,6 +23,7 @@
#include <stdarg.h>
#include "avutil.h"
+#include "attributes.h"
/**
* Describe the class of an AVClass context structure. That is an
@@ -129,11 +130,7 @@ typedef struct {
* subsequent arguments are converted to output.
* @see av_vlog
*/
-#ifdef __GNUC__
-void av_log(void *avcl, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-#else
-void av_log(void *avcl, int level, const char *fmt, ...);
-#endif
+void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
void av_vlog(void *avcl, int level, const char *fmt, va_list);
int av_log_get_level(void);