This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 369dbbe488f526bce8ebb1c3717f61defd8d921b Author: Kacper Michajłow <[email protected]> AuthorDate: Thu Apr 16 19:42:19 2026 +0200 Commit: Kacper Michajłow <[email protected]> CommitDate: Thu Apr 16 18:56:22 2026 +0000 swscale/ops_memcpy: guard exec->in_stride[-1] access When use_loop == true and idx < 0, we would incorrectly check in_stride[idx], which is OOB read. Reorder conditions to avoid that. Signed-off-by: Kacper Michajłow <[email protected]> --- libswscale/ops_memcpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/ops_memcpy.c b/libswscale/ops_memcpy.c index 4d0477b754..1fec8b21c9 100644 --- a/libswscale/ops_memcpy.c +++ b/libswscale/ops_memcpy.c @@ -51,13 +51,13 @@ static void process(const SwsOpExec *exec, const void *priv, const int use_loop = exec->out_stride[i] > bytes + SWS_MAX_PADDING; if (idx < 0 && !use_loop) { memset(out, p->clear_value[i], exec->out_stride[i] * lines); - } else if (exec->out_stride[i] == exec->in_stride[idx] && !use_loop) { - memcpy(out, exec->in[idx], exec->out_stride[i] * lines); } else if (idx < 0) { for (int y = y_start; y < y_end; y++) { memset(out, p->clear_value[i], bytes); out += exec->out_stride[i]; } + } else if (exec->out_stride[i] == exec->in_stride[idx] && !use_loop) { + memcpy(out, exec->in[idx], exec->out_stride[i] * lines); } else { const uint8_t *in = exec->in[idx]; for (int y = y_start; y < y_end; y++) { _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
