mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
amrwbdec: _parse should not return OK if not enough data yet
This commit is contained in:
parent
1d71315dc9
commit
7b51343363
1 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue