Fix divide by zero for non-arm processor
Bug: 31647370
Bug: 33071964
Test: ran PoC for bug 31647370 on x86
Change-Id: Ibf019c01feecc7aca458a0fe35413a3749b5a284
(cherry picked from commit 85c5976f7240553fb26fe209514e04714d37abbf)
diff --git a/Tremolo/res012.c b/Tremolo/res012.c
index be279d0..513d9ad 100644
--- a/Tremolo/res012.c
+++ b/Tremolo/res012.c
@@ -153,7 +153,7 @@
always being at most six bits */
for(k=0;k<partitions_per_word;k++){
ogg_uint32_t div=partword[j][i+k];
- partword[j][i+k]=temp/div;
+ partword[j][i+k]= (div == 0) ? 0 : (temp / div);
temp-=partword[j][i+k]*div;
}
@@ -218,7 +218,7 @@
always being at most six bits */
for(k=0;k<partitions_per_word;k++){
ogg_uint32_t div=partword[i+k];
- partword[i+k]=temp/div;
+ partword[i+k]= (div == 0) ? 0 : (temp / div);
temp-=partword[i+k]*div;
}
}