forked from FFmpeg/FFmpeg
Merge commit 'db347280eb3746d7b70888db97f1efe5f06f5624'
* commit 'db347280eb3746d7b70888db97f1efe5f06f5624': vorbis: fallback to normal division instead of crashing Conflicts: libavcodec/vorbisdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
c5e11e897a
1 changed files with 16 additions and 6 deletions
|
@ -1330,8 +1330,9 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
|
|||
|
||||
av_dlog(NULL, "Classword: %u\n", temp);
|
||||
|
||||
av_assert0(vr->classifications > 1 && temp <= 65536); //needed for inverse[]
|
||||
av_assert0(vr->classifications > 1); //needed for inverse[]
|
||||
|
||||
if (temp <= 65536) {
|
||||
for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
|
||||
temp2 = (((uint64_t)temp) * inverse_class) >> 32;
|
||||
|
||||
|
@ -1339,6 +1340,15 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
|
|||
vr->classifs[p + i] = temp - temp2 * vr->classifications;
|
||||
temp = temp2;
|
||||
}
|
||||
} else {
|
||||
for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
|
||||
temp2 = temp / vr->classifications;
|
||||
|
||||
if (i < vr->ptns_to_read)
|
||||
vr->classifs[p + i] = temp - temp2 * vr->classifications;
|
||||
temp = temp2;
|
||||
}
|
||||
}
|
||||
}
|
||||
p += vr->ptns_to_read;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue