copy: safeguard cursor position

This commit is contained in:
Thomas Schoebel-Theuer 2021-04-16 10:07:55 +02:00
parent 0ed45aa2b5
commit fff046e1d0

View File

@ -294,7 +294,7 @@ int _make_mref(struct copy_brick *brick, int index, int queue, void *data,
int len;
int status = -EAGAIN;
if (brick->clash || end_pos <= 0)
if (brick->clash || pos < 0 || end_pos <= 0 || pos >= end_pos)
goto done;
mref = copy_alloc_mref(brick);