[FFmpeg-devel] [PATCH] Fix printf format warnings

Måns Rullgård mans
Tue Jun 8 12:39:05 CEST 2010


Eli Friedman <eli.friedman at gmail.com> writes:

> Attached are fixes for printf format warnings in
> libavformat/rtpdec_xiph.c and libavformat/oggdec.c.  The pointer
> differences in libavformat/rtpdec_xiph.c have type ptrdiff_t, and
> page_pos in oggdec.c is an int64_t.
>
> -Eli Friedman
>
> Index: libavformat/rtpdec_xiph.c
> ===================================================================
> --- libavformat/rtpdec_xiph.c	(revision 23520)
> +++ libavformat/rtpdec_xiph.c	(working copy)
> @@ -237,7 +237,7 @@
>      if (packed_headers_end - packed_headers < 9) {
>          av_log(codec, AV_LOG_ERROR,
>                 "Invalid %d byte packed header.",
> -               packed_headers_end - packed_headers);
> +               (int)(packed_headers_end - packed_headers));

%zd

>          return AVERROR_INVALIDDATA;
>      }
>
> @@ -259,7 +259,7 @@
>          length1 > length || length2 > length - length1) {
>          av_log(codec, AV_LOG_ERROR,
>                 "Bad packed header lengths (%d,%d,%d,%d)\n", length1,
> -               length2, packed_headers_end - packed_headers, length);
> +               length2, (int)(packed_headers_end - packed_headers), length);

%zd

>          return AVERROR_INVALIDDATA;
>      }
>
>
> Index: libavformat/oggdec.c
> ===================================================================
> --- libavformat/oggdec.c	(revision 23520)
> +++ libavformat/oggdec.c	(working copy)
> @@ -363,7 +363,8 @@
>  #endif
>
>      if (os->granule == -1)
> -        av_log(s, AV_LOG_WARNING, "Page at %lld is missing granule\n", os->page_pos);
> +        av_log(s, AV_LOG_WARNING, "Page at %lld is missing granule\n",
> +               (long long)os->page_pos);

PRId64

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list