| From 87473995b4628e7dde4715db7cd86d1cb559972f Mon Sep 17 00:00:00 2001 |
| From: ArseniyObolenskiy <arseniy.obolenskiy@intel.com> |
| Date: Fri, 9 Oct 2020 17:07:39 +0800 |
| Subject: [PATCH] Add robustness check for superresScaleDenominator in |
| ParsePicParams |
| |
| [Decode] Add robustness check for superresScaleDenominator in ParsePicParams |
| |
| Change-Id: Iaf9f08694149a606c3e4530ce8a1ba77a86478a7 |
| --- |
| .../linux/gen12/codec/ddi/media_ddi_decode_av1_g12.cpp | 3 +++ |
| 1 file changed, 3 insertions(+) |
| |
| diff --git a/media_driver/linux/gen12/codec/ddi/media_ddi_decode_av1_g12.cpp b/media_driver/linux/gen12/codec/ddi/media_ddi_decode_av1_g12.cpp |
| index 8244644a2e26..4d169954857c 100644 |
| --- a/media_driver/linux/gen12/codec/ddi/media_ddi_decode_av1_g12.cpp |
| +++ b/media_driver/linux/gen12/codec/ddi/media_ddi_decode_av1_g12.cpp |
| @@ -396,6 +396,9 @@ VAStatus DdiDecodeAV1::ParsePicParams( |
| // calculate down scaled width |
| if (picAV1Params->m_picInfoFlags.m_fields.m_useSuperres && |
| (picAV1Params->m_superresScaleDenominator != av1ScaleNumerator)) { |
| + if (picAV1Params->m_superresScaleDenominator == 0) { |
| + return VA_STATUS_ERROR_INVALID_PARAMETER; |
| + } |
| uint32_t dsWidth = ((picParam->frame_width_minus1 + 1 ) * |
| av1ScaleNumerator + picAV1Params->m_superresScaleDenominator / 2) / |
| picAV1Params->m_superresScaleDenominator; |
| -- |
| 2.25.1 |
| |