[FFmpeg-devel] [PATCH] avformat/movenc: correct range for movie_timescale

James Almer jamrial at gmail.com
Fri May 7 16:30:30 EEST 2021


On 5/7/2021 10:22 AM, Gyan Doshi wrote:
> ISO 14496-12 declares it as a 32-bit unsigned integer
> ---
>   libavformat/movenc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 2ab507df15..9fe58b312e 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -107,7 +107,7 @@ static const AVOption options[] = {
>       { "wallclock", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MOV_PRFT_SRC_WALLCLOCK}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM, "prft"},
>       { "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MOV_PRFT_SRC_PTS}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM, "prft"},
>       { "empty_hdlr_name", "write zero-length name string in hdlr atoms within mdia and minf atoms", offsetof(MOVMuxContext, empty_hdlr_name), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
> -    { "movie_timescale", "set movie timescale", offsetof(MOVMuxContext, movie_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
> +    { "movie_timescale", "set movie timescale", offsetof(MOVMuxContext, movie_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 1, UINT32_MAX, AV_OPT_FLAG_ENCODING_PARAM},

The type for movie_timescale in MOVMuxContext would need to be changed 
too, and all its uses double checked to make sure nothing breaks.

I see one case where it's used as the den value for AVRational, which is 
an int.

>       { NULL },
>   };
>   
> 



More information about the ffmpeg-devel mailing list