Message ID | 20210214193616.111213-2-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Commit | c9d9c6074689ec11b0ba12dd8c895d3564b06ed7 |
Headers | show |
Series | [FFmpeg-devel,1/2] avutil/video_enc_params: Combine overflow checks | expand |
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 |
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);
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavutil/video_enc_params.c | 4 ++++ 1 file changed, 4 insertions(+)