diff mbox series

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

Message ID 20210324005354.1688230-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 117a41b7e3254b50fe299385e35d94be72ba13b6
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/segafilm.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index 1225227138..675de00ed2 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -201,8 +201,6 @@  static int film_read_header(AVFormatContext *s)
         return AVERROR_INVALIDDATA;
     film->base_clock = AV_RB32(&scratch[8]);
     film->sample_count = AV_RB32(&scratch[12]);
-    if(film->sample_count >= UINT_MAX / sizeof(film_sample))
-        return -1;
     film->sample_table = av_malloc_array(film->sample_count, sizeof(film_sample));
     if (!film->sample_table)
         return AVERROR(ENOMEM);