[FFmpeg-cvslog] avformat/mov: Fix reel_name size check

Andreas Rheinhardt git at videolan.org
Thu Jul 2 14:13:18 EEST 2020


ffmpeg | branch: release/4.0 | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Jun 14 20:54:46 2020 +0200| [bf5f18c5f94978596556a8f74e42ebfe64a947bb] | committer: Andreas Rheinhardt

avformat/mov: Fix reel_name size check

Only read str_size bytes from offset 30 of extradata if the extradata is
indeed at least 30 + str_size bytes long.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
(cherry picked from commit ff3fad6b0edb13dd664403b01bc00309f035b110)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf5f18c5f94978596556a8f74e42ebfe64a947bb
---

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index c3e391e0c1..cd15dd3c26 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2325,7 +2325,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
                 uint32_t format = AV_RB32(st->codecpar->extradata + 22);
                 if (format == AV_RB32("name") && (int64_t)size >= (int64_t)len + 18) {
                     uint16_t str_size = AV_RB16(st->codecpar->extradata + 26); /* string length */
-                    if (str_size > 0 && size >= (int)str_size + 26) {
+                    if (str_size > 0 && size >= (int)str_size + 30) {
                         char *reel_name = av_malloc(str_size + 1);
                         if (!reel_name)
                             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list