[vlc-commits] codec: opus: check comment size overflow

Francois Cartegnie git at videolan.org
Wed Dec 7 22:47:04 CET 2016


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Dec  7 19:45:38 2016 +0100| [d2d450853e95a19f67b221fa22a349b4da6fa59d] | committer: Jean-Baptiste Kempf

codec: opus: check comment size overflow

(cherry picked from commit d72019e145262567f0fc3168eeaa757c5e54f6ae)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=d2d450853e95a19f67b221fa22a349b4da6fa59d
---

 modules/codec/opus_header.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/opus_header.c b/modules/codec/opus_header.c
index 101a33d..4d16599 100644
--- a/modules/codec/opus_header.c
+++ b/modules/codec/opus_header.c
@@ -285,6 +285,9 @@ static int comment_pad(char **comments, size_t *length)
 {
     const unsigned padding = 512; /* default from opus-tools */
 
+    if(SIZE_MAX - *length < padding + 255)
+        return 1;
+
     char *p = *comments;
     /* Make sure there is at least "padding" worth of padding free, and
        round up to the maximum that fits in the current ogg segments. */



More information about the vlc-commits mailing list