amrwbdec: _parse should not return OK if not enough data yet

This commit is contained in:
Mark Nauwelaerts 2012-01-17 11:55:59 +01:00
parent 1d71315dc9
commit 7b51343363

View file

@ -183,7 +183,7 @@ gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
gst_audio_decoder_get_parse_state (dec, &sync, &eos);
/* need to peek data to get the size */
if (gst_adapter_available (adapter) < 1)
if (size < 1)
return GST_FLOW_ERROR;
data = gst_adapter_peek (adapter, 1);
@ -193,6 +193,8 @@ gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
GST_DEBUG_OBJECT (amrwbdec, "mode %d, block %d", mode, block);
if (block) {
if (block > size)
return GST_FLOW_UNEXPECTED;
*offset = 0;
*length = block;
} else {