aacparse: fix uninitialized variables in LOAS config reading

On reading LOAS config, flag v=1 and vA=1 combination can occur, leading to warning
"Spec says "TBD"...". Returning TRUE on this case while parameters 'sample_rate' and
'channels' are pointing to uninitialized values can end on setting random values as
rate and channels on src caps.

https://bugzilla.gnome.org/show_bug.cgi?id=755611
This commit is contained in:
Guillaume Marquebielle 2015-09-25 10:01:37 +02:00 committed by Jan Schmidt
parent 866c86dd37
commit 35139ee8b7

View file

@ -655,6 +655,7 @@ gst_aac_parse_read_loas_config (GstAacParse * aacparse, const guint8 * data,
GST_LOG_OBJECT (aacparse, "More data ignored"); GST_LOG_OBJECT (aacparse, "More data ignored");
} else { } else {
GST_WARNING_OBJECT (aacparse, "Spec says \"TBD\"..."); GST_WARNING_OBJECT (aacparse, "Spec says \"TBD\"...");
return FALSE;
} }
return TRUE; return TRUE;
} }
@ -870,7 +871,7 @@ gst_aac_parse_detect_stream (GstAacParse * aacparse,
if (gst_aac_parse_check_loas_frame (aacparse, data, avail, drain, if (gst_aac_parse_check_loas_frame (aacparse, data, avail, drain,
framesize, &need_data_loas)) { framesize, &need_data_loas)) {
gint rate, channels; gint rate = 0, channels = 0;
GST_INFO ("LOAS, framesize: %d", *framesize); GST_INFO ("LOAS, framesize: %d", *framesize);
@ -1212,7 +1213,7 @@ gst_aac_parse_handle_frame (GstBaseParse * parse,
gboolean lost_sync; gboolean lost_sync;
GstBuffer *buffer; GstBuffer *buffer;
guint framesize; guint framesize;
gint rate, channels; gint rate = 0, channels = 0;
aacparse = GST_AAC_PARSE (parse); aacparse = GST_AAC_PARSE (parse);
buffer = frame->buffer; buffer = frame->buffer;