aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-06-14 20:54:46 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 16:16:48 +0200
commit6ae79b3b138be4c9b20a743b4cd7a44ad2cca790 (patch)
tree38798f7b1cb6a71e461ca1dabfb96add4446b0fd
parentbfa07a9633ffa494d398ea81600ffe56d04acf16 (diff)
downloadffmpeg-6ae79b3b138be4c9b20a743b4cd7a44ad2cca790.tar.gz
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@gmail.com> (cherry picked from commit ff3fad6b0edb13dd664403b01bc00309f035b110) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index eaa7a4d26d..7748446573 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2107,7 +2107,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);