mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
jpegdec: don't crash if jpeg image contains more than three components
Our code currently only handles a maximum of 3 components, so error out for now if the image has more components than that. Fixes #604106.
This commit is contained in:
parent
14e73d15dd
commit
6b2a0c7c46
1 changed files with 10 additions and 0 deletions
|
@ -1031,6 +1031,9 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GST_LOG_OBJECT (dec, "num_components=%d", dec->cinfo.num_components);
|
GST_LOG_OBJECT (dec, "num_components=%d", dec->cinfo.num_components);
|
||||||
GST_LOG_OBJECT (dec, "jpeg_color_space=%d", dec->cinfo.jpeg_color_space);
|
GST_LOG_OBJECT (dec, "jpeg_color_space=%d", dec->cinfo.jpeg_color_space);
|
||||||
|
|
||||||
|
if (dec->cinfo.num_components > 3)
|
||||||
|
goto components_not_supported;
|
||||||
|
|
||||||
#ifndef GST_DISABLE_GST_DEBUG
|
#ifndef GST_DISABLE_GST_DEBUG
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -1296,6 +1299,13 @@ drop_buffer:
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
components_not_supported:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (dec, STREAM, DECODE, (NULL),
|
||||||
|
("more components than supported: %d > 3", dec->cinfo.num_components));
|
||||||
|
ret = GST_FLOW_ERROR;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue