Commit 23ae3cc8 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/oggparsedaala: Do not leave an invalid value in gpshift

Fixes: undefined behavior
Fixes: 702974
Found-by: 's avatarThomas Guilbert <tguilbert@google.com>
Reviewed-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 679a3154
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment