[FFmpeg-cvslog] oggparsevorbis: fix null ptr dereference

Michael Niedermayer git at videolan.org
Thu Jun 7 01:44:17 CEST 2012


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Thu May 31 19:06:14 2012 +0200| [7f0f6602cb3219c9d0e6bd5df33d2b891ac0089b] | committer: Michael Niedermayer

oggparsevorbis: fix null ptr dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 18b46a494ef3592d69f4638dac1ebb613c0f548d)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f0f6602cb3219c9d0e6bd5df33d2b891ac0089b
---

 libavformat/oggparsevorbis.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 78defd7..74f4499 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)



More information about the ffmpeg-cvslog mailing list