mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-09 01:21:06 +00:00
lavc/vorbisdec: use ptrdiff_t to iterate over intptr_t
While this probably never overflows, we are better safe than sorry. The callback prototype should probably also use ptrdiff_t or size_t, but I diggress (this would affect the DSP callback prototype).
This commit is contained in:
committed by
James Almer
parent
129cbbd7be
commit
bbf045aa59
@@ -31,12 +31,12 @@
|
||||
static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
|
||||
intptr_t blocksize)
|
||||
{
|
||||
int i;
|
||||
vector float m, a;
|
||||
vector bool int t0, t1;
|
||||
const vector unsigned int v_31 = //XXX
|
||||
vec_add(vec_add(vec_splat_u32(15),vec_splat_u32(15)),vec_splat_u32(1));
|
||||
for (i = 0; i < blocksize; i += 4) {
|
||||
|
||||
for (ptrdiff_t i = 0; i < blocksize; i += 4) {
|
||||
m = vec_ld(0, mag+i);
|
||||
a = vec_ld(0, ang+i);
|
||||
t0 = vec_cmple(m, (vector float)vec_splat_u32(0));
|
||||
|
||||
@@ -1581,8 +1581,7 @@ static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
|
||||
|
||||
void ff_vorbis_inverse_coupling(float *mag, float *ang, intptr_t blocksize)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < blocksize; i++) {
|
||||
for (ptrdiff_t i = 0; i < blocksize; i++) {
|
||||
if (mag[i] > 0.0) {
|
||||
if (ang[i] > 0.0) {
|
||||
ang[i] = mag[i] - ang[i];
|
||||
|
||||
Reference in New Issue
Block a user