[FFmpeg-cvslog] avutil/video_enc_params: Check for truncation before creating buffer
Andreas Rheinhardt
git at videolan.org
Fri Feb 19 09:27:19 EET 2021
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Feb 14 19:47:45 2021 +0100| [c9d9c6074689ec11b0ba12dd8c895d3564b06ed7] | committer: Andreas Rheinhardt
avutil/video_enc_params: Check for truncation before creating buffer
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9d9c6074689ec11b0ba12dd8c895d3564b06ed7
---
libavutil/video_enc_params.c | 4 ++++
1 file changed, 4 insertions(+)
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);
More information about the ffmpeg-cvslog
mailing list