aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-14 19:47:45 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-19 07:45:39 +0100
commitc9d9c6074689ec11b0ba12dd8c895d3564b06ed7 (patch)
treed0f2fb7f97217e1b92c74de45b98e44e21f48571
parent39df279c741928c6adf223890ff19b457f96b9bf (diff)
downloadffmpeg-c9d9c6074689ec11b0ba12dd8c895d3564b06ed7.tar.gz
avutil/video_enc_params: Check for truncation before creating buffer
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavutil/video_enc_params.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/video_enc_params.c b/libavutil/video_enc_params.c
index b9cdafddbb..635176ab91 100644
--- a/libavutil/video_enc_params.c
+++ b/libavutil/video_enc_params.c
@@ -63,6 +63,10 @@ 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 (size > INT_MAX) {
+ av_free(par);
+ return NULL;
+ }
buf = av_buffer_create((uint8_t *)par, size, NULL, NULL, 0);
if (!buf) {
av_freep(&par);