mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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>
This commit is contained in:
parent
679a315424
commit
23ae3cc822
@ -126,6 +126,7 @@ static int daala_header(AVFormatContext *s, int idx)
|
|||||||
if (hdr->gpshift >= 32) {
|
if (hdr->gpshift >= 32) {
|
||||||
av_log(s, AV_LOG_ERROR, "Too large gpshift %d (>= 32).\n",
|
av_log(s, AV_LOG_ERROR, "Too large gpshift %d (>= 32).\n",
|
||||||
hdr->gpshift);
|
hdr->gpshift);
|
||||||
|
hdr->gpshift = 0;
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
hdr->gpmask = (1U << hdr->gpshift) - 1;
|
hdr->gpmask = (1U << hdr->gpshift) - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user