[FFmpeg-devel] [PATCH] Avoid possible endless loop in dvdsub decoder.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Aug 2 19:30:15 CEST 2011


Decode offsets should be checked to be strictly monotonically
increasing, otherwise an endless loop is possible.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavcodec/dvdsubdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 27a33ea..bc4da13 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -344,7 +344,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 sub_header->rects[0]->pict.linesize[0] = w;
             }
         }
-        if (next_cmd_pos == cmd_pos)
+        if (next_cmd_pos <= cmd_pos)
             break;
         cmd_pos = next_cmd_pos;
     }
-- 
1.7.4.1



More information about the ffmpeg-devel mailing list