[FFmpeg-devel] [PATCH] avutil/video_enc_params: schedule the size overflow check for removal

James Almer jamrial at gmail.com
Mon Apr 5 19:42:26 EEST 2021


On 4/4/2021 3:13 PM, James Almer wrote:
> av_buffer_create() will start taking a size argument of size_t type.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>   libavutil/video_enc_params.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/video_enc_params.c b/libavutil/video_enc_params.c
> index 635176ab91..e6a8e38d94 100644
> --- a/libavutil/video_enc_params.c
> +++ b/libavutil/video_enc_params.c
> @@ -63,10 +63,12 @@ av_video_enc_params_create_side_data(AVFrame *frame, enum AVVideoEncParamsType t
>       par = av_video_enc_params_alloc(type, nb_blocks, &size);
>       if (!par)
>           return NULL;
> +#if FF_API_BUFFER_SIZE_T
>       if (size > INT_MAX) {
>           av_free(par);
>           return NULL;
>       }
> +#endif
>       buf = av_buffer_create((uint8_t *)par, size, NULL, NULL, 0);
>       if (!buf) {
>           av_freep(&par);

Will apply.


More information about the ffmpeg-devel mailing list