summaryrefslogtreecommitdiff
path: root/libavformat/oggparsevorbis.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-31 19:06:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-31 20:25:23 +0200
commit18b46a494ef3592d69f4638dac1ebb613c0f548d (patch)
treeef4d994ea8d08e6207eb8c781d6ab0239d93953f /libavformat/oggparsevorbis.c
parentb02cc2ddc610cd84bbee5923a642a8324988b28c (diff)
oggparsevorbis: fix null ptr dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r--libavformat/oggparsevorbis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 78defd703d..74f44995b8 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -203,12 +203,12 @@ vorbis_header (AVFormatContext * s, int idx)
int pkt_type = os->buf[os->pstart];
if (!(pkt_type & 1))
- return 0;
+ return os->private ? 0 : -1;
if (!os->private) {
os->private = av_mallocz(sizeof(struct oggvorbis_private));
if (!os->private)
- return 0;
+ return -1;
}
if (os->psize < 1 || pkt_type > 5)