[FFmpeg-devel] [PATCH 1/3] timecode: better input checks in init function.

Clément Bœsch ubitux at gmail.com
Mon Dec 12 17:54:50 CET 2011


On Tue, Dec 06, 2011 at 07:50:38PM +0100, Michael Niedermayer wrote:
> On Tue, Dec 06, 2011 at 11:37:37AM +0100, Clément Bœsch wrote:
> > From: Clément Bœsch <clement.boesch at smartjog.com>
> > 
> > ---
> >  libavcodec/timecode.c |   37 ++++++++++++++++++++++++++++++-------
> >  1 files changed, 30 insertions(+), 7 deletions(-)
> > 
> > diff --git a/libavcodec/timecode.c b/libavcodec/timecode.c
> > index 7f3b1d5..4148f32 100644
> > --- a/libavcodec/timecode.c
> > +++ b/libavcodec/timecode.c
> > @@ -55,9 +55,32 @@ uint32_t ff_framenum_to_smtpe_timecode(unsigned frame, int fps, int drop)
> >             (  (frame / (fps * 3600) % 24)) % 10;          // units of hours
> >  }
> >  
> > +static int ff_check_timecode_rate(void *avcl, AVRational rate, int drop)
> > +{
> > +    int fps = (rate.num + rate.den/2) / rate.den;
> > +
> > +    if (!rate.num || !rate.den) {
> > +        av_log(avcl, AV_LOG_ERROR, "Timecode frame rate must be specified\n");
> 
> you check ==0 after dividing by 0
> 
> otherwise teh patch LGTM
> 

Pushed with the check fixed, and the ff_ prefix removed.


-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111212/bdc4ff28/attachment.asc>


More information about the ffmpeg-devel mailing list