[FFmpeg-devel] [PATCH v3 1/4] libavutil/imgutils: add utility to get plane sizes

Brian Kim bkkim at google.com
Tue Jul 14 03:19:18 EEST 2020


On Mon, Jul 13, 2020 at 11:22 AM James Almer <jamrial at gmail.com> wrote:
[...]
> You would need to cast height to size_t for this, i think, but seeing
> av_image_check_size() currently rejects line sizes and plane sizes
> bigger than INT_MAX, maybe we should just keep INT_MAX in the above
> check instead (No need to send a new revision for this, i can amend it
> before pushing with either solution. I just want your opinion).

If we move towards using size_t/ptrdiff_t, it seems to make sense to
use SIZE_MAX so that we do not have to come back and update this
afterwards. It seems like even if we limited the values to INT_MAX
users would think that they should check the range again anyways based
on the type.

However, I am fine with keeping it limited to INT_MAX to keep things
consistent until we can actually use the full range in other places.


More information about the ffmpeg-devel mailing list