[FFmpeg-devel] [PATCH 2/3] avformat/oggparsedaala: Do not leave an invalid value in gpshift

Michael Niedermayer michael at niedermayer.cc
Sat Apr 1 20:18:35 EEST 2017


Fixes: undefined behavior
Fixes: 702974

Found-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/oggparsedaala.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index ce65b2bd7a..a373b41b4c 100644
--- a/libavformat/oggparsedaala.c
+++ b/libavformat/oggparsedaala.c
@@ -126,6 +126,7 @@ static int daala_header(AVFormatContext *s, int idx)
         if (hdr->gpshift >= 32) {
             av_log(s, AV_LOG_ERROR, "Too large gpshift %d (>= 32).\n",
                    hdr->gpshift);
+            hdr->gpshift = 0;
             return AVERROR_INVALIDDATA;
         }
         hdr->gpmask  = (1U << hdr->gpshift) - 1;
-- 
2.11.0



More information about the ffmpeg-devel mailing list