mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
ogg: Always alloc the private context in vorbis_header
It is possible to have an initial broken header and then valid packets. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
f13fe6020e
commit
3562684db7
@ -212,15 +212,15 @@ vorbis_header (AVFormatContext * s, int idx)
|
||||
struct oggvorbis_private *priv;
|
||||
int pkt_type = os->buf[os->pstart];
|
||||
|
||||
if (!(pkt_type & 1))
|
||||
return 0;
|
||||
|
||||
if (!os->private) {
|
||||
os->private = av_mallocz(sizeof(struct oggvorbis_private));
|
||||
if (!os->private)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(pkt_type & 1))
|
||||
return 0;
|
||||
|
||||
if (os->psize < 1 || pkt_type > 5)
|
||||
return -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user