diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-06-14 20:54:46 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-06-15 17:30:33 +0200 |
commit | 716b5c6ec9f856ea973298c8e319f041871080e7 (patch) | |
tree | df79b4fc6a3c39aef31da8a0afae9a5a1ccec320 | |
parent | 9d921e38f436a431e6d457fe7e4700878e7327b9 (diff) | |
download | ffmpeg-716b5c6ec9f856ea973298c8e319f041871080e7.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)
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index a59c804d16..4e68532b69 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2342,7 +2342,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); |