diff options
author | Josep Torra <n770galaxy@gmail.com> | 2013-03-30 10:57:08 +0100 |
---|---|---|
committer | Josep Torra <n770galaxy@gmail.com> | 2013-03-30 10:57:08 +0100 |
commit | b6719fe0e3e1f8339dd791f8453b171170dfa106 (patch) | |
tree | 7431f0c466784c2d9d33b968e9b6a61d89a28a2e | |
parent | 030cf658e688dedac3f1f50338786d90c7d80d94 (diff) |
midiparser: ensure variable is initialized and fix debug message access
-rw-r--r-- | gst/midi/midiparse.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/midi/midiparse.c b/gst/midi/midiparse.c index 916fc8c68..990147980 100644 --- a/gst/midi/midiparse.c +++ b/gst/midi/midiparse.c @@ -845,6 +845,8 @@ find_midi_chunk (GstMidiParse * midiparse, guint8 * data, guint size, { guint32 type; + *length = 0; + if (size < 8) goto short_chunk; @@ -908,7 +910,7 @@ find_midi_chunk (GstMidiParse * midiparse, guint8 * data, guint size, /* ERRORS */ short_chunk: { - GST_LOG_OBJECT (midiparse, "not enough data %u < %u", length + 8, size); + GST_LOG_OBJECT (midiparse, "not enough data %u < %u", *length + 8, size); return FALSE; } invalid_format: |