mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 02:12:28 +00:00
avformat/oggparseflac: check init_get_bits' result
Check init_get_bits' result for NULL, to avoid dereferencing a NULL pointer later (CWE-476). Without this, a segfault happens when trying to decode a handcrafted ogg-flac file with an absurdly long (e.g. 268435455 bytes) ogg header. Co-authored-by: James Almer <jamrial@gmail.com> Signed-off-by: Paul Arzelier <paul.arzelier@free.fr>
This commit is contained in:
parent
4d9afbeef5
commit
a9042db1d3
@ -40,7 +40,10 @@ flac_header (AVFormatContext * s, int idx)
|
||||
if (os->buf[os->pstart] == 0xff)
|
||||
return 0;
|
||||
|
||||
init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
|
||||
ret = init_get_bits8(&gb, os->buf + os->pstart, os->psize);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
skip_bits1(&gb); /* metadata_last */
|
||||
mdt = get_bits(&gb, 7);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user