diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-03 20:09:53 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-03 20:09:53 +0200 |
commit | 99c7b516414e76c90446a865ca5a02df3117f694 (patch) | |
tree | d793a74b8f421f96259a5e6dcab3f1fbe2e68787 | |
parent | 1816addc4ebedd8d08633fbff0daf52bf4e4b77f (diff) | |
download | ffmpeg-99c7b516414e76c90446a865ca5a02df3117f694.tar.gz |
Abort if command offset decreases, avoids potential endless loop.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
-rw-r--r-- | libavcodec/dvdsubdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 27a33eaef2..1c3d75e2e3 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; |