From a35157debf22f915fe125111efbc0fff3bcf4418 Mon Sep 17 00:00:00 2001 From: Aaron Boxer Date: Mon, 5 Aug 2019 17:15:57 -0400 Subject: [PATCH] jpeg2000parse: initialize some variables to make valgrind happy --- gst/videoparsers/gstjpeg2000parse.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gst/videoparsers/gstjpeg2000parse.c b/gst/videoparsers/gstjpeg2000parse.c index 4b00158cd6..fcba59abf4 100644 --- a/gst/videoparsers/gstjpeg2000parse.c +++ b/gst/videoparsers/gstjpeg2000parse.c @@ -298,17 +298,18 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse, GstCaps *current_caps = NULL; GstStructure *current_caps_struct = NULL; GstJPEG2000Colorspace colorspace = GST_JPEG2000_COLORSPACE_NONE; - guint x0, y0, x1, y1; + guint x0 = 0, y0 = 0, x1 = 0, y1 = 0; guint width = 0, height = 0; + guint i; guint8 dx[GST_JPEG2000_PARSE_MAX_SUPPORTED_COMPONENTS]; guint8 dy[GST_JPEG2000_PARSE_MAX_SUPPORTED_COMPONENTS]; - guint16 numcomps; + guint16 numcomps = 0; guint16 capabilities = 0; guint16 profile = 0; gboolean validate_main_level = FALSE; guint8 main_level = 0; guint8 sub_level = 0; - guint16 compno; + guint16 compno = 0; GstJPEG2000Sampling parsed_sampling = GST_JPEG2000_SAMPLING_NONE; const gchar *sink_sampling_string = NULL; GstJPEG2000Sampling sink_sampling = GST_JPEG2000_SAMPLING_NONE; @@ -317,6 +318,11 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse, GstCaps *src_caps = NULL; guint eoc_frame_size = 0; + for (i = 0; i < GST_JPEG2000_PARSE_MAX_SUPPORTED_COMPONENTS; ++i) { + dx[i] = 1; + dy[i] = 1; + } + if (!gst_buffer_map (frame->buffer, &map, GST_MAP_READ)) { GST_ERROR_OBJECT (jpeg2000parse, "Unable to map buffer"); return GST_FLOW_ERROR;