# HG changeset patch # User reimar # Date 1141823256 0 # Node ID 28c2108f1cfa2283947c17ed1ddaa0d3002a9eea # Parent 30fa0638b78dff03fb025697ad9a8741635ff6c3 "i < sizeof(buf)" must be "i < sizeof(buf) - 5", since later buf[i + 5] is used. diff -r 30fa0638b78d -r 28c2108f1cfa libmpdemux/demux_audio.c --- a/libmpdemux/demux_audio.c Wed Mar 08 13:00:51 2006 +0000 +++ b/libmpdemux/demux_audio.c Wed Mar 08 13:07:36 2006 +0000 @@ -312,7 +312,7 @@ unsigned char buf[16384]; // vlc uses 16384*4 (4 dts frames) unsigned int i; stream_read(s, buf, sizeof(buf)); - for (i = 0; i < sizeof(buf); i += 2) { + for (i = 0; i < sizeof(buf) - 5; i += 2) { // DTS, 14 bit, LE if((buf[i] == 0xff) && (buf[i+1] == 0x1f) && (buf[i+2] == 0x00) && (buf[i+3] == 0xe8) && ((buf[i+4] & 0xfe) == 0xf0) && (buf[i+5] == 0x07)) {