[Decode] Components exceed the value specified by Jpeg spec

jpeg components number should not exceed 4 following the spec

Signed-off-by: Liu, Chuan1 <chuan1.liu@intel.com>
This commit is contained in:
chuanli1 2022-03-11 05:06:58 +00:00 committed by XinfengZhang
parent bfb6b98ed6
commit ec1c44c19a
2 changed files with 3 additions and 2 deletions

View File

@ -87,7 +87,7 @@ struct jpeg_sos {
unsigned int component_id;
unsigned int dc_selector;
unsigned int ac_selector;
} components[4];
} components[COMPONENTS];
};
struct jdec_private {

View File

@ -277,7 +277,8 @@ static int parse_SOS(struct jdec_private *priv, const unsigned char *stream)
{
unsigned int i, cid, table;
unsigned int nr_components = stream[2];
if(nr_components > COMPONENTS)
error("Components exceed the value specified by the Jpeg spec\n");
trace("> SOS marker\n");
priv->cur_sos.nr_components = nr_components;