[FFmpeg-cvslog] Abort if command offset decreases, avoids potential endless loop.

Reimar Döffinger git at videolan.org
Wed Aug 3 20:10:55 CEST 2011


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Wed Aug  3 20:09:53 2011 +0200| [99c7b516414e76c90446a865ca5a02df3117f694] | committer: Reimar Döffinger

Abort if command offset decreases, avoids potential endless loop.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

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

 libavcodec/dvdsubdec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 27a33ea..1c3d75e 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -344,6 +344,10 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 sub_header->rects[0]->pict.linesize[0] = w;
             }
         }
+        if (next_cmd_pos < cmd_pos) {
+            av_log(NULL, AV_LOG_ERROR, "Invalid command offset\n");
+            break;
+        }
         if (next_cmd_pos == cmd_pos)
             break;
         cmd_pos = next_cmd_pos;



More information about the ffmpeg-cvslog mailing list