SHARE
TWEET

Untitled

a guest Sep 26th, 2010 112 Never
  1. Index: firmware/buffer.c
  2. ===================================================================
  3. --- firmware/buffer.c   (revision 28167)
  4. +++ firmware/buffer.c   (working copy)
  5. @@ -20,6 +20,7 @@
  6.   ****************************************************************************/
  7.  #include <stdio.h>
  8.  #include "buffer.h"
  9. +#include "panic.h"
  10.  
  11.  #if (CONFIG_PLATFORM & PLATFORM_HOSTED)
  12.  unsigned char audiobuffer[(MEM*1024-256)*1024];
  13. @@ -44,6 +45,9 @@
  14.      audiobuf += size;
  15.      /* 32-bit aligned */
  16.      audiobuf = (void *)(((unsigned long)audiobuf + 3) & ~3);
  17. +    if (audiobuf > audiobufend) {
  18. +        panicf("OOM: %d bytes", (int) size);
  19. +    }
  20.      
  21.      return retval;
  22.  }
RAW Paste Data
Top