Commit fd165ace authored by Michael Niedermayer's avatar Michael Niedermayer

golomb: check log validity before shifting

Fixes invalid right shift in fate-cavs
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d084c5c7
......@@ -66,10 +66,14 @@ static inline int get_ue_golomb(GetBitContext *gb){
return ff_ue_golomb_vlc_code[buf];
}else{
log= 2*av_log2(buf) - 31;
buf>>= log;
buf--;
LAST_SKIP_BITS(re, gb, 32 - log);
CLOSE_READER(re, gb);
if (CONFIG_FTRAPV && log < 0) {
av_log(0, AV_LOG_ERROR, "Invalid UE golomb code\n");
return AVERROR_INVALIDDATA;
}
buf>>= log;
buf--;
return buf;
}
......
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