[FFmpeg-devel] [PATCH 1/2] wtv: detect ole date overflow

Michael Niedermayer michaelni at gmx.at
Mon May 9 04:18:38 CEST 2011


On Sun, May 08, 2011 at 09:28:23PM +1000, Peter Ross wrote:
> ---
>  libavformat/wtv.c |   18 +++++++++++++-----
>  1 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/wtv.c b/libavformat/wtv.c
> index 795ea39..ee7bdda 100644
> --- a/libavformat/wtv.c
> +++ b/libavformat/wtv.c
> @@ -425,11 +425,16 @@ static void crazytime_to_iso8601(char *buf, int buf_size, int64_t value)
>  
>  /**
>   * Convert OLE DATE to ISO-8601 string
> + * @return <0 on error
>   */
> -static void oledate_to_iso8601(char *buf, int buf_size, int64_t value)
> +static int oledate_to_iso8601(char *buf, int buf_size, int64_t value)
>  {
>      time_t t = 631112400LL + 86400*av_int2dbl(value);
> -    strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
> +    struct tm result;
> +    if (!gmtime_r(&t, &result))

according to our windows expert this produces:
error: implicit declaration of function ‘gmtime_r’

I thus replaced it by gmtime again as a quick compile fix

also see: libavforma/cutils.c brktimegm()

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Incandescent light bulbs waste a lot of energy as heat so the EU forbids them.
Their replacement, compact fluorescent lamps, much more expensive, dont fit in
many old lamps, flicker, contain toxic mercury, produce a fraction of the light
that is claimed and in a unnatural spectrum rendering colors different than
in natural light. Ah and we now need to turn the heaters up more in winter to
compensate the lower wasted heat. Who wins? Not the environment, thats for sure
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110509/0926cbfa/attachment.asc>


More information about the ffmpeg-devel mailing list