From 84441152622dbcb6a4b7301771eb3cae1a0a6014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 27 May 2024 22:02:31 +0300 Subject: [PATCH] lavc/startcode: fix RVV return value on no match If there are no zero bytes, t2 equals -1. The code cannot simply fall through to the match case. --- libavcodec/riscv/startcode_rvv.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/riscv/startcode_rvv.S b/libavcodec/riscv/startcode_rvv.S index 7c43b1d7f3..36a3369431 100644 --- a/libavcodec/riscv/startcode_rvv.S +++ b/libavcodec/riscv/startcode_rvv.S @@ -37,6 +37,8 @@ func ff_startcode_find_candidate_rvv, zve32x bgez t2, 2f add t0, t0, t1 bnez a1, 1b + + mv t2, zero 2: add t0, t0, t2 sub a0, t0, a0