[FFmpeg-cvslog] Fix heap-buffer-overflow in matroska_parse_block

Dale Curtis git at videolan.org
Tue May 14 01:54:57 CEST 2013


ffmpeg | branch: release/1.0 | Dale Curtis <dalecurtis at chromium.org> | Tue Mar 26 14:12:30 2013 -0700| [e489d5c54d3f45f18cac3f73345e4206ef1a9302] | committer: Michael Niedermayer

Fix heap-buffer-overflow in matroska_parse_block

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 81e85bc95cb1e4f8cc7b1ba71ec027c8791b55d1)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e489d5c54d3f45f18cac3f73345e4206ef1a9302
---

 libavformat/matroskadec.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 19ebe78..f562fa4 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1885,10 +1885,10 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
 }
 
 static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
-                                int size, int type,
+                                int* buf_size, int type,
                                 uint32_t **lace_buf, int *laces)
 {
-    int res = 0, n;
+    int res = 0, n, size = *buf_size;
     uint8_t *data = *buf;
     uint32_t *lace_size;
 
@@ -1986,6 +1986,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
 
     *buf      = data;
     *lace_buf = lace_size;
+    *buf_size = size;
 
     return res;
 }
@@ -2205,7 +2206,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
             matroska->skip_to_keyframe = 0;
     }
 
-    res = matroska_parse_laces(matroska, &data, size, (flags & 0x06) >> 1,
+    res = matroska_parse_laces(matroska, &data, &size, (flags & 0x06) >> 1,
                                &lace_size, &laces);
 
     if (res)



More information about the ffmpeg-cvslog mailing list