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-16 16:00:22 +0200
commit0a966b056fd6106e352dab97e5fd6f17d47ebbbc (patch)
tree811bd6dbba93f4df245813a2fd0fe075cb128eb1
parentdc4fc2520072535bbaaa7cfdfa3cda8078cc1627 (diff)
downloadffmpeg-0a966b056fd6106e352dab97e5fd6f17d47ebbbc.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 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;