cavsvideo_probe() returns a high score whenever it finds a valid
sequence and picture start code, even when the sequence header appears
only after unrelated leading data. This can make valid JPEG files probe
as CAVS.
Keep the high score when the sequence header is at the start of the
probed stream. Otherwise return AVPROBE_SCORE_EXTENSION / 2 so stronger
probes can win.
Signed-off-by: Xiujun Wang <xiujunwang.dev@gmail.com>
The init section is read through a fixed-size AVIO buffer. When it
needs more than one read, copying from the start again duplicates the
first chunk and corrupts the data that follows. Copy from the current
read offset instead.
Fixes: #24603
Signed-off-by: Xiujun Wang <xiujunwang.dev@gmail.com>
The CAVS motion compensation code computes source pointers before checking whether the reference frame is available. Move the existing check before the pointer arithmetic to avoid undefined behavior when a missing reference frame is encountered.
Fixes: #24649
Signed-off-by: Xiujun Wang <xiujunwang.dev@gmail.com>