[FFmpeg-cvslog] avcodec/vorbis_parser: Move vp check

Michael Niedermayer git at videolan.org
Sun Nov 16 18:19:07 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 16 18:06:03 2014 +0100| [374c907fb35f8236547b24d792fbb9bed201e321] | committer: Michael Niedermayer

avcodec/vorbis_parser: Move vp check

Fixes null pointer dereference
Fixes CID1251347

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

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

 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 0d72fb1..b99f115 100644
--- a/libavcodec/vorbis_parser.c
+++ b/libavcodec/vorbis_parser.c
@@ -330,9 +330,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 ffmpeg-cvslog mailing list