Janne Grunau <janne-li...@jannau.net> writes:

> Sample count and delta are in ISO 14496-12 clearly specified as
> unsigned int.
> Fixes an assert caused by negative avg_frame_rate deduced from a
> negative duraton computed in mov_read_stts().
> ---
>  libavformat/isom.h | 4 ++--
>  libavformat/mov.c  | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/isom.h b/libavformat/isom.h
> index 932b1d0..f4a178b 100644
> --- a/libavformat/isom.h
> +++ b/libavformat/isom.h
> @@ -43,8 +43,8 @@ int ff_mov_lang_to_iso639(unsigned code, char to[4]);
>   */
>
>  typedef struct MOVStts {
> -    int count;
> -    int duration;
> +    unsigned count;
> +    unsigned duration;
>  } MOVStts;
>
>  typedef struct MOVStsc {
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 35c07bd..a121aa5 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -1664,8 +1664,8 @@ static int mov_read_stts(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>          return AVERROR(ENOMEM);
>
>      for (i = 0; i < entries && !pb->eof_reached; i++) {
> -        int sample_duration;
> -        int sample_count;
> +        unsigned sample_duration;
> +        unsigned sample_count;
>
>          sample_count=avio_rb32(pb);
>          sample_duration = avio_rb32(pb);
> -- 

LGTM

Although the Apple quicktime spec is a bit vague regarding the signedness
of fields, it does remark that the durations non-negative, and a negative
value for either count or duration would be meaningless.

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to