fix[avs2d]: fix parser segment fault

If packet is splited outside of mpp and video_sequence_start_code is not
guaranteed, there will not be valid NALS. Thus segment fault will
happen.

Change-Id: Idb5e51772384c6663260d382b94845a8e1ac7c35
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding 2025-11-07 10:49:43 +08:00
parent 3b338216a4
commit acd5537923

View file

@ -607,7 +607,7 @@ MPP_RET avs2d_parse_prepare_fast(Avs2dCtx_t *p_dec, MppPacket *pkt, HalDecTask *
p_curdata = p_end - remain + 1;
}
if (p_dec->new_frame_flag || (p_dec->p_nals[p_dec->nal_cnt - 1].eof == 1)
if (p_dec->new_frame_flag || (p_dec->nal_cnt && (p_dec->p_nals[p_dec->nal_cnt - 1].eof == 1))
|| p_curdata >= p_end) {
task->valid = 1;
break;