aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-04-01 19:18:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-17 20:35:19 +0200
commited0c3290f86d929236a16c38de32c3c431b799e9 (patch)
tree07634b45055856da3e87091d792100577c4cbdbe
parent98f93f5272ea3f159d9410ddfbba9ef51eebf838 (diff)
downloadffmpeg-ed0c3290f86d929236a16c38de32c3c431b799e9.tar.gz
avformat/oggparsedaala: Do not leave an invalid value in gpshift
Fixes: undefined behavior Fixes: 702974 Found-by: Thomas Guilbert <tguilbert@google.com> Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 23ae3cc822915ede2bb4e85047ab46cc5bc71268) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggparsedaala.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index 1ca1c36fa3..9e98d49c8f 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;