<div class="gmail_extra"><br><br><div class="gmail_quote">26. huhtikuuta 2012 15.49 Casian Andrei <span dir="ltr"><<a href="mailto:skeletk13@gmail.com" target="_blank">skeletk13@gmail.com</a>></span> kirjoitti:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The total size of the buffer (i_size) was initialized with the whole<br>
allocated size for the block. This fooled block_Realloc() in the case of<br>
resizing to slightly larger, with the extra size in range from<br>
32 to 32 + 80 bytes. block_Realloc() assumed it had enough space left in<br>
the buffer padding to avoid reallocating memory.<br>
<br>
Consequently, the block ended up with a i_buffer field with a value<br>
larger than the allocated memory around p_buffer.<br>
<br>
In the end, this could cause memory corruptions in all sorts of cases.<br>
In my case, vlc was crashing while encoutering a corrupted mp3 file.<br></blockquote><div><br></div><div>Did you see any corrupted text in VLC messages? (like main debug: play3r3b2 ...)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

---<br>
 src/misc/block.c |    2 +-<br>
 1 files changed, 1 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/src/misc/block.c b/src/misc/block.c<br>
index bed781d..bd62b9d 100644<br>
--- a/src/misc/block.c<br>
+++ b/src/misc/block.c<br>
@@ -133,7 +133,7 @@ block_t *block_Alloc (size_t size)<br>
     if (unlikely(b == NULL))<br>
         return NULL;<br>
<br>
-    block_Init (b, b + 1, alloc);<br>
+    block_Init (b, b + 1, alloc - sizeof (block_t));<br>
     static_assert ((BLOCK_PADDING % BLOCK_ALIGN) == 0,<br>
                    "BLOCK_PADDING must be a multiple of BLOCK_ALIGN");<br>
     b->p_buffer += BLOCK_PADDING + BLOCK_ALIGN - 1;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.7<br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</font></span></blockquote></div><br></div>