From a93fa19467ac2568cfe32332b789b315e37dbdf1 Mon Sep 17 00:00:00 2001
From: Chris Watkins <w...@chromium.org>
Date: Mon, 20 Apr 2015 14:23:57 -0700
Subject: [PATCH] oggparsedirac: check return value of init_get_bits

If init_get_bits fails the GetBitContext is invalid and must not be
used. Check the return value in dirac_header and propogate the error.

Signed-off-by: Chris Watkins <w...@chromium.org>
---
 libavformat/oggparsedirac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c
index 10fb07e..35be655 100644
--- a/libavformat/oggparsedirac.c
+++ b/libavformat/oggparsedirac.c
@@ -36,7 +36,9 @@ static int dirac_header(AVFormatContext *s, int idx)
     if (st->codec->codec_id == AV_CODEC_ID_DIRAC)
         return 0;
 
-    init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8);
+    if (init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8) < 0)
+        return -1;
+
     if (avpriv_dirac_parse_sequence_header(st->codec, &gb, &source) < 0)
         return -1;
 
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to