From 9abbe8cc136e7fbc69004df3f1de9d54c40d969d Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 17 Jun 2011 10:31:11 +0300 Subject: Use av_printf_format to check the usage of printf style functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ö --- libavformat/avio.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'libavformat/avio.h') diff --git a/libavformat/avio.h b/libavformat/avio.h index e07e3c3c92..bb2d9f85a6 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -284,11 +284,7 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s); #define URL_EOF (-1) attribute_deprecated int url_fgetc(AVIOContext *s); attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size); -#ifdef __GNUC__ -attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); -#else -attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...); -#endif +attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); attribute_deprecated void put_flush_packet(AVIOContext *s); attribute_deprecated int url_open_dyn_buf(AVIOContext **s); attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); @@ -463,11 +459,7 @@ static av_always_inline int64_t avio_tell(AVIOContext *s) int64_t avio_size(AVIOContext *s); /** @warning currently size is limited */ -#ifdef __GNUC__ -int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); -#else -int avio_printf(AVIOContext *s, const char *fmt, ...); -#endif +int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); void avio_flush(AVIOContext *s); -- cgit v1.2.3