From 79ec5f6b31f5ce86e504fd92529f897bc0368365 Mon Sep 17 00:00:00 2001 From: "shihong.zheng" Date: Wed, 20 Mar 2019 10:13:14 +0800 Subject: [PATCH] vc1: oversize vc1 streams limit. [1/1] PD#TV-3303 Problem: played vc1 oversize stream cause sys no response. Solution: limit oversize vc1 stream. Verify: x301 Change-Id: Ifc75c1025b2bd81642b5659feffdd42111a286d8 Signed-off-by: shihong.zheng --- .../media_modules/frame_provider/decoder/vc1/vvc1.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/vc1/vvc1.c b/drivers/amlogic/media_modules/frame_provider/decoder/vc1/vvc1.c index 86f171ad8f67..d5bbfe78f667 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/vc1/vvc1.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/vc1/vvc1.c @@ -54,6 +54,8 @@ #define NV21 #endif +#define VC1_MAX_SUPPORT_SIZE (1920*1088) + #define I_PICTURE 0 #define P_PICTURE 1 #define B_PICTURE 2 @@ -1143,9 +1145,18 @@ static int amvdec_vc1_probe(struct platform_device *pdev) return -EFAULT; } - if (pdata->sys_info) + if (pdata->sys_info) { vvc1_amstream_dec_info = *pdata->sys_info; + if ((vvc1_amstream_dec_info.height != 0) && + (vvc1_amstream_dec_info.width > + (VC1_MAX_SUPPORT_SIZE/vvc1_amstream_dec_info.height))) { + pr_info("amvdec_vc1: over size, unsupport: %d * %d\n", + vvc1_amstream_dec_info.width, + vvc1_amstream_dec_info.height); + return -EFAULT; + } + } pdata->dec_status = vvc1_dec_status; pdata->set_isreset = vvc1_set_isreset; is_reset = 0;