aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-20 12:02:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-20 12:02:18 +0200
commitc5e11e897a9db005e93acffe1673aa8a25d18095 (patch)
tree96cceabf77f5e918b175bbaea5acdfc255b91fb1
parented113d7a6b2d1ff414c1127f955119643e915812 (diff)
parentdb347280eb3746d7b70888db97f1efe5f06f5624 (diff)
downloadffmpeg-c5e11e897a9db005e93acffe1673aa8a25d18095.tar.gz
Merge commit 'db347280eb3746d7b70888db97f1efe5f06f5624'
* commit 'db347280eb3746d7b70888db97f1efe5f06f5624': vorbis: fallback to normal division instead of crashing Conflicts: libavcodec/vorbisdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vorbisdec.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 661943f8b3..c4063eb3bc 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1330,14 +1330,24 @@ 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[]
- for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
- temp2 = (((uint64_t)temp) * inverse_class) >> 32;
+ if (temp <= 65536) {
+ for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
+ temp2 = (((uint64_t)temp) * inverse_class) >> 32;
- if (i < vr->ptns_to_read)
- vr->classifs[p + i] = temp - temp2 * vr->classifications;
- temp = temp2;
+ if (i < vr->ptns_to_read)
+ 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;