mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-02 18:48:27 +00:00
id3v2: check for end of file while unescaping tags
Prevent an out of buffer bound write.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit af4cc2605c
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
d8745de6ae
commit
5aac081110
@ -626,9 +626,10 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
|
||||
goto seek;
|
||||
}
|
||||
b = buffer;
|
||||
while (avio_tell(s->pb) < end) {
|
||||
while (avio_tell(s->pb) < end && !s->pb->eof_reached) {
|
||||
*b++ = avio_r8(s->pb);
|
||||
if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1) {
|
||||
if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1 &&
|
||||
!s->pb->eof_reached ) {
|
||||
uint8_t val = avio_r8(s->pb);
|
||||
*b++ = val ? val : avio_r8(s->pb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user