diff mbox series

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

Message ID 20210404181342.768-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel] avutil/video_enc_params: schedule the size overflow check for removal
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

James Almer April 4, 2021, 6:13 p.m. UTC
av_buffer_create() will start taking a size argument of size_t type.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/video_enc_params.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

James Almer April 5, 2021, 4:42 p.m. UTC | #1
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@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.
diff mbox series

Patch

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);