[FFmpeg-devel] [PATCH 3/3] lavf/mxfdec: validate month/day before date formatting

Michael Niedermayer michaelni at gmx.at
Sat Apr 13 18:05:55 CEST 2013


On Sat, Apr 13, 2013 at 05:38:43PM +0200, Matthieu Bouron wrote:
> On Sat, Apr 13, 2013 at 03:45:57PM +0200, Hendrik Leppkes wrote:
> > Some implementations of strftime do not like invalid values for
> > month/day, so ensure it doesn't happen.
> > ---
> >  libavformat/mxfdec.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index 6306756..aa29cd8 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -1668,6 +1668,10 @@ static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
> >      time.tm_min  = (timestamp >> 16 & 0xF);
> >      time.tm_sec  = (timestamp >> 8  & 0xF);
> >  
> > +    /* ensure month/day are valid */
> > +    time.tm_mon  = FFMAX(time.tm_mon, 0);
> > +    time.tm_mday = FFMAX(time.tm_mday, 1);
> > +
> >      *str = av_mallocz(32);
> >      if (!*str)
> >          return AVERROR(ENOMEM);
> > -- 
> > 1.8.1.msysgit.1
> > 
> 
> Looks OK.

applied

thanks

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- 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/20130413/5ebf6c45/attachment.asc>


More information about the ffmpeg-devel mailing list