changeset 15932:9bb26af4f477

Revert fix v1.3, it breaks streams with cook audio (ex. rtsp://mm4.rai.it/raitre/blob/ultimo/blob.rm) Applied a different fix for the first buf[k] (ensure buf size is k+4) The second buf[k] is safe, buf is at least 32 when the code is called
author rtognimp
date Wed, 06 Jul 2005 21:37:38 +0000
parents 545e7ec8bce7
children 97985bcfb3b3
files libmpdemux/realrtsp/sdpplin.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/realrtsp/sdpplin.c	Wed Jul 06 21:10:02 2005 +0000
+++ b/libmpdemux/realrtsp/sdpplin.c	Wed Jul 06 21:37:38 2005 +0000
@@ -80,18 +80,18 @@
       a[i] = (char) c;
       b[i] = (char) dtable[c];
     }
-    out = xbuffer_ensure_size(out, k+3);
+    out = xbuffer_ensure_size(out, k+4);
     out[k++] = (b[0] << 2) | (b[1] >> 4);
     out[k++] = (b[1] << 4) | (b[2] >> 2);
     out[k++] = (b[2] << 6) | b[3];
     i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3);
     if (i < 3) {
-      out[k - 1]=0;
+      out[k]=0;
       *size=k;
       return out;
     }
   }
-  out[k - 1]=0;
+  out[k]=0;
   *size=k;
   return out;
 }