mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-19 05:17:04 +00:00
avformat/mov: Fix memleak upon encountering repeating tags
mov_read_custom tries to read three strings belonging to three different tags. When an already encountered tag is encountered again, a new buffer for the string to be read is allocated and stored in the pointer destined for this particular tag. But in this scenario, said pointer already holds the address of the string read earlier, leading to a leak. This commit therefore aborts the reading process upon encountering an already encountered tag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
6de6ce7bc8
commit
dfef1d5e3c
@ -4434,6 +4434,9 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
} else
|
||||
break;
|
||||
|
||||
if (*p)
|
||||
break;
|
||||
|
||||
*p = av_malloc(len + 1);
|
||||
if (!*p) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
|
Loading…
Reference in New Issue
Block a user