Fixed buffer overflows in resamplers.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 28 Dec 2009 08:28:24 +0000
changeset 3602 bfa8d34ce03a
parent 3601 240a7700a271
child 3603 847549156244
Fixed buffer overflows in resamplers. I'm not confident this is a complete fix, but I'm not confident the current resamplers are really worth keeping at all, either.
src/audio/SDL_audiotypecvt.c
src/audio/sdlgenaudiocvt.pl
--- a/src/audio/SDL_audiotypecvt.c	Thu Dec 24 21:00:42 2009 +0000
+++ b/src/audio/SDL_audiotypecvt.c	Mon Dec 28 08:28:24 2009 +0000
@@ -7109,7 +7109,7 @@
     const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Uint8 *target = ((const Uint8 *) cvt->buf) - 1;
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample0 = (Sint16) src[0];
         src--;
         dst[1] = (Uint8) ((sample0 + last_sample0) >> 1);
@@ -7137,7 +7137,7 @@
     const Uint8 *src = (Uint8 *) cvt->buf;
     const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         src += 2;
         dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
@@ -7164,7 +7164,7 @@
     const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Uint8 *target = ((const Uint8 *) cvt->buf) - 1;
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample0 = (Sint16) src[0];
         src--;
         dst[3] = (Uint8) sample0;
@@ -7194,7 +7194,7 @@
     const Uint8 *src = (Uint8 *) cvt->buf;
     const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         src += 4;
         dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
@@ -7222,7 +7222,7 @@
     const Uint8 *target = ((const Uint8 *) cvt->buf) - 2;
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample0 = (Sint16) src[0];
         src -= 2;
@@ -7255,7 +7255,7 @@
     const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) src[0];
     Sint16 last_sample1 = (Sint16) src[1];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         src += 4;
@@ -7286,7 +7286,7 @@
     const Uint8 *target = ((const Uint8 *) cvt->buf) - 2;
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample0 = (Sint16) src[0];
         src -= 2;
@@ -7323,7 +7323,7 @@
     const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) src[0];
     Sint16 last_sample1 = (Sint16) src[1];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         src += 8;
@@ -7356,7 +7356,7 @@
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample3 = (Sint16) src[3];
         const Sint16 sample2 = (Sint16) src[2];
         const Sint16 sample1 = (Sint16) src[1];
@@ -7399,7 +7399,7 @@
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample3 = (Sint16) src[3];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample2 = (Sint16) src[2];
@@ -7438,7 +7438,7 @@
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample3 = (Sint16) src[3];
         const Sint16 sample2 = (Sint16) src[2];
         const Sint16 sample1 = (Sint16) src[1];
@@ -7489,7 +7489,7 @@
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample3 = (Sint16) src[3];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample2 = (Sint16) src[2];
@@ -7530,7 +7530,7 @@
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample5 = (Sint16) src[5];
         const Sint16 sample4 = (Sint16) src[4];
         const Sint16 sample3 = (Sint16) src[3];
@@ -7583,7 +7583,7 @@
     Sint16 last_sample3 = (Sint16) src[3];
     Sint16 last_sample4 = (Sint16) src[4];
     Sint16 last_sample5 = (Sint16) src[5];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample2 = (Sint16) src[2];
@@ -7630,7 +7630,7 @@
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample5 = (Sint16) src[5];
         const Sint16 sample4 = (Sint16) src[4];
         const Sint16 sample3 = (Sint16) src[3];
@@ -7695,7 +7695,7 @@
     Sint16 last_sample3 = (Sint16) src[3];
     Sint16 last_sample4 = (Sint16) src[4];
     Sint16 last_sample5 = (Sint16) src[5];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample2 = (Sint16) src[2];
@@ -7744,7 +7744,7 @@
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample7 = (Sint16) src[7];
         const Sint16 sample6 = (Sint16) src[6];
         const Sint16 sample5 = (Sint16) src[5];
@@ -7807,7 +7807,7 @@
     Sint16 last_sample5 = (Sint16) src[5];
     Sint16 last_sample6 = (Sint16) src[6];
     Sint16 last_sample7 = (Sint16) src[7];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample2 = (Sint16) src[2];
@@ -7862,7 +7862,7 @@
     Sint16 last_sample2 = (Sint16) src[2];
     Sint16 last_sample1 = (Sint16) src[1];
     Sint16 last_sample0 = (Sint16) src[0];
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample7 = (Sint16) src[7];
         const Sint16 sample6 = (Sint16) src[6];
         const Sint16 sample5 = (Sint16) src[5];
@@ -7941,7 +7941,7 @@
     Sint16 last_sample5 = (Sint16) src[5];
     Sint16 last_sample6 = (Sint16) src[6];
     Sint16 last_sample7 = (Sint16) src[7];
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) src[0];
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample2 = (Sint16) src[2];
@@ -7989,7 +7989,7 @@
     const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint8 *target = ((const Sint8 *) cvt->buf) - 1;
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src--;
         dst[1] = (Sint8) ((sample0 + last_sample0) >> 1);
@@ -8017,7 +8017,7 @@
     const Sint8 *src = (Sint8 *) cvt->buf;
     const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src += 2;
         dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
@@ -8044,7 +8044,7 @@
     const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint8 *target = ((const Sint8 *) cvt->buf) - 1;
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src--;
         dst[3] = (Sint8) sample0;
@@ -8074,7 +8074,7 @@
     const Sint8 *src = (Sint8 *) cvt->buf;
     const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src += 4;
         dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
@@ -8102,7 +8102,7 @@
     const Sint8 *target = ((const Sint8 *) cvt->buf) - 2;
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src -= 2;
@@ -8135,7 +8135,7 @@
     const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         src += 4;
@@ -8166,7 +8166,7 @@
     const Sint8 *target = ((const Sint8 *) cvt->buf) - 2;
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src -= 2;
@@ -8203,7 +8203,7 @@
     const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         src += 8;
@@ -8236,7 +8236,7 @@
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
@@ -8279,7 +8279,7 @@
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
@@ -8318,7 +8318,7 @@
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
@@ -8369,7 +8369,7 @@
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
@@ -8410,7 +8410,7 @@
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
         const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
         const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
@@ -8463,7 +8463,7 @@
     Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
     Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
     Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
@@ -8510,7 +8510,7 @@
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
         const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
         const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
@@ -8575,7 +8575,7 @@
     Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
     Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
     Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
@@ -8624,7 +8624,7 @@
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
         const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
         const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
@@ -8687,7 +8687,7 @@
     Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
     Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
     Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
@@ -8742,7 +8742,7 @@
     Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
     Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
     Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
         const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
         const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
@@ -8821,7 +8821,7 @@
     Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
     Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
     Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
@@ -8869,7 +8869,7 @@
     const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src--;
         dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
@@ -8897,7 +8897,7 @@
     const Uint16 *src = (Uint16 *) cvt->buf;
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src += 2;
         dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
@@ -8924,7 +8924,7 @@
     const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src--;
         dst[3] = (Uint16) sample0;
@@ -8954,7 +8954,7 @@
     const Uint16 *src = (Uint16 *) cvt->buf;
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src += 4;
         dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
@@ -8982,7 +8982,7 @@
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src -= 2;
@@ -9015,7 +9015,7 @@
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         src += 4;
@@ -9046,7 +9046,7 @@
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src -= 2;
@@ -9083,7 +9083,7 @@
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         src += 8;
@@ -9116,7 +9116,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
@@ -9159,7 +9159,7 @@
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
@@ -9198,7 +9198,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
@@ -9249,7 +9249,7 @@
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
@@ -9290,7 +9290,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
         const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
         const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
@@ -9343,7 +9343,7 @@
     Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
     Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
     Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
@@ -9390,7 +9390,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
         const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
         const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
@@ -9455,7 +9455,7 @@
     Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
     Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
     Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
@@ -9504,7 +9504,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
         const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
         const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
@@ -9567,7 +9567,7 @@
     Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
     Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
     Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
@@ -9622,7 +9622,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
         const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
         const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
@@ -9701,7 +9701,7 @@
     Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
     Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
     Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
@@ -9749,7 +9749,7 @@
     const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src--;
         dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
@@ -9777,7 +9777,7 @@
     const Sint16 *src = (Sint16 *) cvt->buf;
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src += 2;
         dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
@@ -9804,7 +9804,7 @@
     const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src--;
         dst[3] = (Sint16) sample0;
@@ -9834,7 +9834,7 @@
     const Sint16 *src = (Sint16 *) cvt->buf;
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src += 4;
         dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
@@ -9862,7 +9862,7 @@
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src -= 2;
@@ -9895,7 +9895,7 @@
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         src += 4;
@@ -9926,7 +9926,7 @@
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src -= 2;
@@ -9963,7 +9963,7 @@
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         src += 8;
@@ -9996,7 +9996,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
@@ -10039,7 +10039,7 @@
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
@@ -10078,7 +10078,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
@@ -10129,7 +10129,7 @@
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
@@ -10170,7 +10170,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
         const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
@@ -10223,7 +10223,7 @@
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
     Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
@@ -10270,7 +10270,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
         const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
@@ -10335,7 +10335,7 @@
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
     Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
@@ -10384,7 +10384,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
         const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
@@ -10447,7 +10447,7 @@
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
     Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
     Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
@@ -10502,7 +10502,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
         const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
@@ -10581,7 +10581,7 @@
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
     Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
     Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
@@ -10629,7 +10629,7 @@
     const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src--;
         dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
@@ -10657,7 +10657,7 @@
     const Uint16 *src = (Uint16 *) cvt->buf;
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src += 2;
         dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
@@ -10684,7 +10684,7 @@
     const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src--;
         dst[3] = (Uint16) sample0;
@@ -10714,7 +10714,7 @@
     const Uint16 *src = (Uint16 *) cvt->buf;
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src += 4;
         dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
@@ -10742,7 +10742,7 @@
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src -= 2;
@@ -10775,7 +10775,7 @@
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         src += 4;
@@ -10806,7 +10806,7 @@
     const Uint16 *target = ((const Uint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src -= 2;
@@ -10843,7 +10843,7 @@
     const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         src += 8;
@@ -10876,7 +10876,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
@@ -10919,7 +10919,7 @@
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
@@ -10958,7 +10958,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
@@ -11009,7 +11009,7 @@
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
@@ -11050,7 +11050,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
         const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
         const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
@@ -11103,7 +11103,7 @@
     Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
     Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
     Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
@@ -11150,7 +11150,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
         const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
         const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
@@ -11215,7 +11215,7 @@
     Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
     Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
     Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
@@ -11264,7 +11264,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
         const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
         const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
@@ -11327,7 +11327,7 @@
     Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
     Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
     Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
@@ -11382,7 +11382,7 @@
     Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
     Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
     Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
         const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
         const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
@@ -11461,7 +11461,7 @@
     Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
     Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
     Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
@@ -11509,7 +11509,7 @@
     const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src--;
         dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
@@ -11537,7 +11537,7 @@
     const Sint16 *src = (Sint16 *) cvt->buf;
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src += 2;
         dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
@@ -11564,7 +11564,7 @@
     const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 1;
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src--;
         dst[3] = (Sint16) sample0;
@@ -11594,7 +11594,7 @@
     const Sint16 *src = (Sint16 *) cvt->buf;
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src += 4;
         dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
@@ -11622,7 +11622,7 @@
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src -= 2;
@@ -11655,7 +11655,7 @@
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         src += 4;
@@ -11686,7 +11686,7 @@
     const Sint16 *target = ((const Sint16 *) cvt->buf) - 2;
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src -= 2;
@@ -11723,7 +11723,7 @@
     const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         src += 8;
@@ -11756,7 +11756,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
@@ -11799,7 +11799,7 @@
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
@@ -11838,7 +11838,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
@@ -11889,7 +11889,7 @@
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
@@ -11930,7 +11930,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
         const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
@@ -11983,7 +11983,7 @@
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
     Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
@@ -12030,7 +12030,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
         const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
         const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
@@ -12095,7 +12095,7 @@
     Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
     Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
@@ -12144,7 +12144,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
         const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
@@ -12207,7 +12207,7 @@
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
     Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
     Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
@@ -12262,7 +12262,7 @@
     Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
     Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
     Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
         const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
         const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
@@ -12341,7 +12341,7 @@
     Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
     Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
     Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
@@ -12389,7 +12389,7 @@
     const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 1;
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src--;
         dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
@@ -12417,7 +12417,7 @@
     const Sint32 *src = (Sint32 *) cvt->buf;
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src += 2;
         dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
@@ -12444,7 +12444,7 @@
     const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 1;
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src--;
         dst[3] = (Sint32) sample0;
@@ -12474,7 +12474,7 @@
     const Sint32 *src = (Sint32 *) cvt->buf;
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src += 4;
         dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
@@ -12502,7 +12502,7 @@
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 2;
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src -= 2;
@@ -12535,7 +12535,7 @@
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         src += 4;
@@ -12566,7 +12566,7 @@
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 2;
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src -= 2;
@@ -12603,7 +12603,7 @@
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         src += 8;
@@ -12636,7 +12636,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
@@ -12679,7 +12679,7 @@
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
@@ -12718,7 +12718,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
@@ -12769,7 +12769,7 @@
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
@@ -12810,7 +12810,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
         const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
@@ -12863,7 +12863,7 @@
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
     Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
@@ -12910,7 +12910,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
         const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
@@ -12975,7 +12975,7 @@
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
     Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
@@ -13024,7 +13024,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
         const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
@@ -13087,7 +13087,7 @@
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
     Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
     Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
@@ -13142,7 +13142,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
         const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
@@ -13221,7 +13221,7 @@
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
     Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
     Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
@@ -13269,7 +13269,7 @@
     const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 1;
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src--;
         dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
@@ -13297,7 +13297,7 @@
     const Sint32 *src = (Sint32 *) cvt->buf;
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src += 2;
         dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
@@ -13324,7 +13324,7 @@
     const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 1;
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src--;
         dst[3] = (Sint32) sample0;
@@ -13354,7 +13354,7 @@
     const Sint32 *src = (Sint32 *) cvt->buf;
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src += 4;
         dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
@@ -13382,7 +13382,7 @@
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 2;
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src -= 2;
@@ -13415,7 +13415,7 @@
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         src += 4;
@@ -13446,7 +13446,7 @@
     const Sint32 *target = ((const Sint32 *) cvt->buf) - 2;
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src -= 2;
@@ -13483,7 +13483,7 @@
     const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         src += 8;
@@ -13516,7 +13516,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
@@ -13559,7 +13559,7 @@
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
@@ -13598,7 +13598,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
@@ -13649,7 +13649,7 @@
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
@@ -13690,7 +13690,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
         const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
@@ -13743,7 +13743,7 @@
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
     Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
@@ -13790,7 +13790,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
         const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
         const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
@@ -13855,7 +13855,7 @@
     Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
     Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
@@ -13904,7 +13904,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
         const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
@@ -13967,7 +13967,7 @@
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
     Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
     Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
@@ -14022,7 +14022,7 @@
     Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
     Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
     Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst != target) {
+    while (dst > target) {
         const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
         const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
         const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
@@ -14101,7 +14101,7 @@
     Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
     Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
     Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-    while (dst != target) {
+    while (dst < target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
@@ -14149,7 +14149,7 @@
     const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
     const float *target = ((const float *) cvt->buf) - 1;
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src--;
         dst[1] = (float) ((sample0 + last_sample0) * 0.5);
@@ -14177,7 +14177,7 @@
     const float *src = (float *) cvt->buf;
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src += 2;
         dst[0] = (float) ((sample0 + last_sample0) * 0.5);
@@ -14204,7 +14204,7 @@
     const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
     const float *target = ((const float *) cvt->buf) - 1;
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src--;
         dst[3] = (float) sample0;
@@ -14234,7 +14234,7 @@
     const float *src = (float *) cvt->buf;
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src += 4;
         dst[0] = (float) ((sample0 + last_sample0) * 0.5);
@@ -14262,7 +14262,7 @@
     const float *target = ((const float *) cvt->buf) - 2;
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src -= 2;
@@ -14295,7 +14295,7 @@
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         src += 4;
@@ -14326,7 +14326,7 @@
     const float *target = ((const float *) cvt->buf) - 2;
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src -= 2;
@@ -14363,7 +14363,7 @@
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         src += 8;
@@ -14396,7 +14396,7 @@
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample3 = (double) SDL_SwapFloatLE(src[3]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
@@ -14439,7 +14439,7 @@
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
@@ -14478,7 +14478,7 @@
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample3 = (double) SDL_SwapFloatLE(src[3]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
@@ -14529,7 +14529,7 @@
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
@@ -14570,7 +14570,7 @@
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample5 = (double) SDL_SwapFloatLE(src[5]);
         const double sample4 = (double) SDL_SwapFloatLE(src[4]);
         const double sample3 = (double) SDL_SwapFloatLE(src[3]);
@@ -14623,7 +14623,7 @@
     double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
     double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
     double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
@@ -14670,7 +14670,7 @@
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample5 = (double) SDL_SwapFloatLE(src[5]);
         const double sample4 = (double) SDL_SwapFloatLE(src[4]);
         const double sample3 = (double) SDL_SwapFloatLE(src[3]);
@@ -14735,7 +14735,7 @@
     double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
     double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
     double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
@@ -14784,7 +14784,7 @@
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample7 = (double) SDL_SwapFloatLE(src[7]);
         const double sample6 = (double) SDL_SwapFloatLE(src[6]);
         const double sample5 = (double) SDL_SwapFloatLE(src[5]);
@@ -14847,7 +14847,7 @@
     double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
     double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
     double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
@@ -14902,7 +14902,7 @@
     double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample7 = (double) SDL_SwapFloatLE(src[7]);
         const double sample6 = (double) SDL_SwapFloatLE(src[6]);
         const double sample5 = (double) SDL_SwapFloatLE(src[5]);
@@ -14981,7 +14981,7 @@
     double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
     double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
     double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample2 = (double) SDL_SwapFloatLE(src[2]);
@@ -15029,7 +15029,7 @@
     const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
     const float *target = ((const float *) cvt->buf) - 1;
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src--;
         dst[1] = (float) ((sample0 + last_sample0) * 0.5);
@@ -15057,7 +15057,7 @@
     const float *src = (float *) cvt->buf;
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src += 2;
         dst[0] = (float) ((sample0 + last_sample0) * 0.5);
@@ -15084,7 +15084,7 @@
     const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
     const float *target = ((const float *) cvt->buf) - 1;
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src--;
         dst[3] = (float) sample0;
@@ -15114,7 +15114,7 @@
     const float *src = (float *) cvt->buf;
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src += 4;
         dst[0] = (float) ((sample0 + last_sample0) * 0.5);
@@ -15142,7 +15142,7 @@
     const float *target = ((const float *) cvt->buf) - 2;
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src -= 2;
@@ -15175,7 +15175,7 @@
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         src += 4;
@@ -15206,7 +15206,7 @@
     const float *target = ((const float *) cvt->buf) - 2;
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src -= 2;
@@ -15243,7 +15243,7 @@
     const float *target = (const float *) (cvt->buf + dstsize);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         src += 8;
@@ -15276,7 +15276,7 @@
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample3 = (double) SDL_SwapFloatBE(src[3]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
@@ -15319,7 +15319,7 @@
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
@@ -15358,7 +15358,7 @@
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample3 = (double) SDL_SwapFloatBE(src[3]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
@@ -15409,7 +15409,7 @@
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
@@ -15450,7 +15450,7 @@
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample5 = (double) SDL_SwapFloatBE(src[5]);
         const double sample4 = (double) SDL_SwapFloatBE(src[4]);
         const double sample3 = (double) SDL_SwapFloatBE(src[3]);
@@ -15503,7 +15503,7 @@
     double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
     double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
     double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
@@ -15550,7 +15550,7 @@
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample5 = (double) SDL_SwapFloatBE(src[5]);
         const double sample4 = (double) SDL_SwapFloatBE(src[4]);
         const double sample3 = (double) SDL_SwapFloatBE(src[3]);
@@ -15615,7 +15615,7 @@
     double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
     double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
     double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
@@ -15664,7 +15664,7 @@
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample7 = (double) SDL_SwapFloatBE(src[7]);
         const double sample6 = (double) SDL_SwapFloatBE(src[6]);
         const double sample5 = (double) SDL_SwapFloatBE(src[5]);
@@ -15727,7 +15727,7 @@
     double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
     double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
     double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
@@ -15782,7 +15782,7 @@
     double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
     double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
     double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst != target) {
+    while (dst > target) {
         const double sample7 = (double) SDL_SwapFloatBE(src[7]);
         const double sample6 = (double) SDL_SwapFloatBE(src[6]);
         const double sample5 = (double) SDL_SwapFloatBE(src[5]);
@@ -15861,7 +15861,7 @@
     double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
     double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
     double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
-    while (dst != target) {
+    while (dst < target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample2 = (double) SDL_SwapFloatBE(src[2]);
--- a/src/audio/sdlgenaudiocvt.pl	Thu Dec 24 21:00:42 2009 +0000
+++ b/src/audio/sdlgenaudiocvt.pl	Mon Dec 28 08:28:24 2009 +0000
@@ -537,15 +537,19 @@
     const int dstsize = cvt->len_cvt $lencvtop $multiple;
 EOF
 
+    my $endcomparison = '!=';
+
     # Upsampling (growing the buffer) needs to work backwards, since we
     #  overwrite the buffer as we go.
     if ($upsample) {
+        $endcomparison = '>';  # dst > target
         print <<EOF;
     $fctype *dst = (($fctype *) (cvt->buf + dstsize)) - $channels;
     const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels;
     const $fctype *target = ((const $fctype *) cvt->buf) - $channels;
 EOF
     } else {
+        $endcomparison = '<';  # dst < target
         print <<EOF;
     $fctype *dst = ($fctype *) cvt->buf;
     const $fctype *src = ($fctype *) cvt->buf;
@@ -562,7 +566,7 @@
     }
 
     print <<EOF;
-    while (dst != target) {
+    while (dst $endcomparison target) {
 EOF
 
     for (my $i = 0; $i < $channels; $i++) {