mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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 ff3fad6b0e
)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
ed1339dcb2
commit
bf5f18c5f9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user