[FFmpeg-devel] [PATCH] lavf/movenc: suggest video_track_timescale for invalid timescale

Michael Niedermayer michael at niedermayer.cc
Tue Oct 11 16:49:56 EEST 2016


On Tue, Oct 11, 2016 at 02:40:57PM +0200, Alexey Eromenko wrote:
> I have written a different patch, which should auto-fix the problem,
> but I can't compile and test it now (due to build system issues):
> movenc.c affects both MP4 and MOV containers, right ?
> 
> ====
> 
> --- ./movenc.c.orig     2016-10-11 06:24:44.328730759 -0400
> +++ ./ffmpeg-3.1.3/ffmpeg-3.1.3/libavformat/movenc.c    2016-10-11
> 08:12:50.626150035 -0400
> @@ -5533,22 +5533,26 @@
>                  track->timescale = mov->video_track_timescale;
>              } else {
>                  track->timescale = st->time_base.den;
>                  while(track->timescale < 10000)
>                      track->timescale *= 2;
>              }
> +            if (track->timescale > 100000) {
> +                int timescale_new = ((st->time_base.den) * (0x10000)) /
> +                (st->time_base.num)*1000;
> +                av_log(s, AV_LOG_WARNING,
> +                       "WARNING codec timebase is very high. If
> duration is too long,\n"

this patch is corrupted by newlines, check your word wrap settings
also patches must be git patches against git master, this is against
3.1 and not a git format-patch (lacking commit message and author)

about the code itself, theres a integer overflow in your code

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

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161011/52180416/attachment.sig>


More information about the ffmpeg-devel mailing list