[FFmpeg-devel] [PATCH] make av_set_pts_info more robust

Michael Niedermayer michaelni
Wed Jul 1 22:23:24 CEST 2009


On Wed, Jul 01, 2009 at 08:39:50PM +0200, Reimar D?ffinger wrote:
> Hello,
> I don't have a sample file for the issue, but the AVI demuxer and probably
> more pass on user data unchecked to av_set_pts_info.
> So I propose to change it in a way that will avoid a division by 0.
> Not sure if that's the best idea, but it seemed like a good idea (I
> originally thought this was the cause of a crash I am investigating).
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c	(revision 19317)
> +++ libavformat/utils.c	(working copy)
> @@ -3308,8 +3308,10 @@
>  {
>      unsigned int gcd= av_gcd(pts_num, pts_den);
>      s->pts_wrap_bits = pts_wrap_bits;
> +    if (pts_num > 0 && pts_den > 0) {
>      s->time_base.num = pts_num/gcd;
>      s->time_base.den = pts_den/gcd;
> +    }

rejected, this is definitly not reasonable

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090701/8fa02b0c/attachment.pgp>



More information about the ffmpeg-devel mailing list