You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avformat/subfile: clip seek offset
Fixes: signed integer overflow: 9223372036854737920 + 1649410 cannot be represented in type 'int64_t' Fixes OSS-Fuzz: 410100610 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
@ -128,13 +128,13 @@ static int64_t subfile_seek(URLContext *h, int64_t pos, int whence)
|
|||||||
case AVSEEK_SIZE:
|
case AVSEEK_SIZE:
|
||||||
return end - c->start;
|
return end - c->start;
|
||||||
case SEEK_SET:
|
case SEEK_SET:
|
||||||
new_pos = c->start + pos;
|
new_pos = c->start + av_clip(pos, 0, end - c->start);
|
||||||
break;
|
break;
|
||||||
case SEEK_CUR:
|
case SEEK_CUR:
|
||||||
new_pos = c->pos + pos;
|
new_pos = c->pos + av_clip(pos, -(c->pos - c->start), end - c->pos);
|
||||||
break;
|
break;
|
||||||
case SEEK_END:
|
case SEEK_END:
|
||||||
new_pos = end + pos;
|
new_pos = end + av_clip(pos, -(end - c->start), 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_assert0(0);
|
av_assert0(0);
|
||||||
|
Reference in New Issue
Block a user