[SCM] libav/experimental: Off by one fix to prevent possible segfault. Patch by jwestfall at surrealistic dot net.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:45:59 UTC 2013


The following commit has been merged in the experimental branch:
commit dd1a74d25decd6eaa7c78a7062fa12edb043efaf
Author: jwestfall at surrealistic.net <jwestfall at surrealistic.net>
Date:   Sat Jan 14 17:43:22 2006 +0000

    Off by one fix to prevent possible segfault. Patch by jwestfall at surrealistic dot net.
    
    Originally committed as revision 4857 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 514ff29..c582ad7 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2178,7 +2178,7 @@ static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
     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 @@ static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
         }
         buf_ptr += 2;
     }
-    buf_end += 2; //undo the hack above
+    buf_end += 3; //undo the hack above
 
     *pbuf_ptr = buf_end;
     return -1;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list