mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 19:31:12 +00:00
amrnbdec: _parse should not return OK if not enough data yet
This commit is contained in:
parent
683f5eeae7
commit
1d71315dc9
1 changed files with 4 additions and 1 deletions
|
@ -257,7 +257,7 @@ gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
|
||||||
gst_audio_decoder_get_parse_state (dec, &sync, &eos);
|
gst_audio_decoder_get_parse_state (dec, &sync, &eos);
|
||||||
|
|
||||||
/* need to peek data to get the size */
|
/* need to peek data to get the size */
|
||||||
if (gst_adapter_available (adapter) < 1)
|
if (size < 1)
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
|
|
||||||
data = gst_adapter_peek (adapter, 1);
|
data = gst_adapter_peek (adapter, 1);
|
||||||
|
@ -280,6 +280,9 @@ gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (amrnbdec, "mode %d, block %d", mode, block);
|
GST_DEBUG_OBJECT (amrnbdec, "mode %d, block %d", mode, block);
|
||||||
|
|
||||||
|
if (block > size)
|
||||||
|
return GST_FLOW_UNEXPECTED;
|
||||||
|
|
||||||
*offset = 0;
|
*offset = 0;
|
||||||
*length = block;
|
*length = block;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue