"Ronald S. Bultje" <[email protected]> writes:

> From: "Ronald S. Bultje" <[email protected]>
>
> ---
>  libavformat/mxfdec.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index dd10240..a7c1890 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -700,7 +700,7 @@ static int mxf_read_index_entry_array(AVIOContext *pb, 
> MXFIndexTableSegment *seg
>          return 0;
>      else if (segment->nb_index_entries < 0 ||
>               segment->nb_index_entries >
> -             (INT_MAX >> av_log2(sizeof(*segment->stream_offset_entries))))
> +             (INT_MAX / sizeof(*segment->stream_offset_entries)))
>          return AVERROR(ENOMEM);
>
>      length = avio_rb32(pb);
> @@ -1084,7 +1084,7 @@ static int mxf_compute_ptses_fake_index(MXFContext 
> *mxf, MXFIndexTable *index_ta
>      if (index_table->nb_ptses <= 0)
>          return 0;
>
> -    if (index_table->nb_ptses > INT_MAX >> av_log2(sizeof(AVIndexEntry)) + 1)
> +    if (index_table->nb_ptses >= INT_MAX / sizeof(AVIndexEntry))
>          return AVERROR(ENOMEM);

What happened to the +1?

The change is good since it makes these expressions constant, but I'm
curious why it is needed for msvc.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to