Commit 81d02c86 authored by reimar's avatar reimar

Fix cmd_pos bounds check to avoid the overflow case.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19640 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 4da4386e
......@@ -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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment