# HG changeset patch # User banan # Date 1137260602 0 # Node ID c5e521489fdfd8c92ffff17b94f394adbccff2ec # Parent ed98beb48872ffff48f3a892a46276c0ccb3160b Off by one fix to prevent possible segfault. Patch by jwestfall at surrealistic dot net. diff -r ed98beb48872 -r c5e521489fdf mpeg12.c --- a/mpeg12.c Sat Jan 14 15:54:58 2006 +0000 +++ b/mpeg12.c Sat Jan 14 17:43:22 2006 +0000 @@ -2178,7 +2178,7 @@ const uint8_t *buf_ptr= *pbuf_ptr; buf_ptr++; //gurantees that -1 is within the array - buf_end -= 2; // gurantees that +2 is within the array + buf_end -= 3; // gurantees that +3 is within the array while (buf_ptr < buf_end) { if(*buf_ptr==0){ @@ -2192,7 +2192,7 @@ } buf_ptr += 2; } - buf_end += 2; //undo the hack above + buf_end += 3; //undo the hack above *pbuf_ptr = buf_end; return -1;