[SCM] libav/experimental: Fix cmd_pos bounds check to avoid the overflow case.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:50:03 UTC 2013


The following commit has been merged in the experimental branch:
commit ffbe087b589506cb0e671fa711e5c2c6ea203ac0
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Sat Aug 15 00:02:42 2009 +0000

    Fix cmd_pos bounds check to avoid the overflow case.
    
    Originally committed as revision 19640 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index a99b7af..b445d3e 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -191,7 +191,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
 
     cmd_pos = READ_OFFSET(buf + cmd_pos);
 
-    while ((cmd_pos + 2 + offset_size) < buf_size) {
+    while (cmd_pos > 0 && cmd_pos < buf_size - 2 - offset_size) {
         date = AV_RB16(buf + cmd_pos);
         next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2);
         dprintf(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list