mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
golomb: check log validity before shifting
Fixes invalid right shift in fate-cavs Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d084c5c742
commit
fd165ace7b
@ -66,10 +66,14 @@ static inline int get_ue_golomb(GetBitContext *gb){
|
|||||||
return ff_ue_golomb_vlc_code[buf];
|
return ff_ue_golomb_vlc_code[buf];
|
||||||
}else{
|
}else{
|
||||||
log= 2*av_log2(buf) - 31;
|
log= 2*av_log2(buf) - 31;
|
||||||
buf>>= log;
|
|
||||||
buf--;
|
|
||||||
LAST_SKIP_BITS(re, gb, 32 - log);
|
LAST_SKIP_BITS(re, gb, 32 - log);
|
||||||
CLOSE_READER(re, gb);
|
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;
|
return buf;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user