mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avutil/video_enc_params: Check for truncation before creating buffer
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
39df279c74
commit
c9d9c60746
@ -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);
|
par = av_video_enc_params_alloc(type, nb_blocks, &size);
|
||||||
if (!par)
|
if (!par)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (size > INT_MAX) {
|
||||||
|
av_free(par);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
buf = av_buffer_create((uint8_t *)par, size, NULL, NULL, 0);
|
buf = av_buffer_create((uint8_t *)par, size, NULL, NULL, 0);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
av_freep(&par);
|
av_freep(&par);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user