From d1b73032f320b87b8f88a0a2b17840181fcd876f Mon Sep 17 00:00:00 2001 From: "xueman.ruan" Date: Fri, 19 Jul 2024 14:46:36 +0800 Subject: [PATCH] fix[m2vd]: Fix seq_head check error The width and height is 16 aligned. Issue occurs by commit: I03732d5eec1902b6fbe80b1504e729b3a1d61330 Change-Id: Icf9b53942f8c5c15536114638d5763545eae8b26 Signed-off-by: xueman.ruan --- mpp/codec/dec/m2v/m2vd_parser.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index 5a08bd82..20f70b01 100644 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -958,14 +958,18 @@ static int m2vd_decode_seq_header(M2VDParserContext *ctx) RK_U32 width = m2vd_read_bits(bx, 12); RK_U32 height = m2vd_read_bits(bx, 12); + ctx->display_width = width; + ctx->display_height = height; + + height = MPP_ALIGN(height, 16); + width = MPP_ALIGN(width, 16); + if (width != ctx->seq_head.decode_width || height != ctx->seq_head.decode_height) ctx->info_changed = 1; ctx->seq_head.decode_width = width; ctx->seq_head.decode_height = height; - ctx->display_width = ctx->seq_head.decode_width; - ctx->display_height = ctx->seq_head.decode_height; ctx->seq_head.aspect_ratio_information = m2vd_read_bits(bx, 4); ctx->seq_head.frame_rate_code = m2vd_read_bits(bx, 4); if (!ctx->frame_period || pre_frame_rate_code != ctx->seq_head.frame_rate_code) @@ -1274,8 +1278,6 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx) pic_head->pre_temporal_reference = pic_head->temporal_reference; pic_head->pre_picture_coding_type = pic_head->picture_coding_type; ctx->frame_cur->picCodingType = pic_head->picture_coding_type; - ctx->seq_head.decode_height = (ctx->seq_head.decode_height + 15) & (~15); - ctx->seq_head.decode_width = (ctx->seq_head.decode_width + 15) & (~15); mpp_frame_set_width(ctx->frame_cur->f, ctx->display_width); mpp_frame_set_height(ctx->frame_cur->f, ctx->display_height);