]> git.sesse.net Git - ffmpeg/commitdiff
avformat/sierravmd: Remove outdated check
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Mar 2021 00:39:50 +0000 (01:39 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 28 Mar 2021 17:09:29 +0000 (19:09 +0200)
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

index 40bcb779861c655be1400145772e6d47abb977f3..11a883614fc0398cf7d3c7b9c8a218b1ca679fd5 100644 (file)
@@ -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) {