diff mbox series

[FFmpeg-devel,3/3] avformat/sierravmd: Remove outdated check

Message ID 20210324005354.1688230-3-andreas.rheinhardt@gmail.com
State Accepted
Commit 440a401d89198adf718d521bd6cd28a70d8f87ce
Headers show
Series [FFmpeg-devel,1/3] avformat/utils: Remove redundant check
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

Andreas Rheinhardt March 24, 2021, 12:53 a.m. UTC
The check has been added at a time when the code performed the
multiplication itself instead of deferring it to av_malloc_array()
and when our allocation functions used unsigned instead of size_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/sierravmd.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 40bcb77986..11a883614f 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -186,10 +186,6 @@  static int vmd_read_header(AVFormatContext *s)
     vmd->frame_table = NULL;
     sound_buffers = AV_RL16(&vmd->vmd_header[808]);
     raw_frame_table_size = vmd->frame_count * 6;
-    if(vmd->frame_count * vmd->frames_per_block >= UINT_MAX / sizeof(vmd_frame) - sound_buffers){
-        av_log(s, AV_LOG_ERROR, "vmd->frame_count * vmd->frames_per_block too large\n");
-        return -1;
-    }
     raw_frame_table = av_malloc(raw_frame_table_size);
     vmd->frame_table = av_malloc_array(vmd->frame_count * vmd->frames_per_block + sound_buffers, sizeof(vmd_frame));
     if (!raw_frame_table || !vmd->frame_table) {