changeset 3045:c5e521489fdf libavcodec

Off by one fix to prevent possible segfault. Patch by jwestfall at surrealistic dot net.
author banan
date Sat, 14 Jan 2006 17:43:22 +0000
parents ed98beb48872
children 1127b4455bec
files mpeg12.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;