[libav-commits] vorbis_parser: Move vp check to avoid a null pointer dereference

Michael Niedermayer git at libav.org
Tue Nov 25 03:01:55 CET 2014


Module: libav
Branch: master
Commit: 62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f

Author:    Michael Niedermayer <michaelni at gmx.at>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Mon Nov 24 15:48:27 2014 +0000

vorbis_parser: Move vp check to avoid a null pointer dereference

CC: libav-stable at libav.org
Bug-Id: CID 1251347

---

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

diff --git a/libavcodec/vorbis_parser.c b/libavcodec/vorbis_parser.c
index 231706c..054635d 100644
--- a/libavcodec/vorbis_parser.c
+++ b/libavcodec/vorbis_parser.c
@@ -303,9 +303,9 @@ static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
 
     if (!s->vp && avctx->extradata && avctx->extradata_size) {
         s->vp = av_vorbis_parse_init(avctx->extradata, avctx->extradata_size);
-        if (!s->vp)
-            goto end;
     }
+    if (!s->vp)
+        goto end;
 
     if ((duration = av_vorbis_parse_frame(s->vp, buf, buf_size)) >= 0)
         s1->duration = duration;



More information about the libav-commits mailing list