diff options
author | Mark Nauwelaerts | 2012-01-17 04:55:14 -0600 |
---|---|---|
committer | Nikhil Devshatwar | 2013-05-17 04:40:54 -0500 |
commit | 37376663aef30f59f9a4af509691359b99501ae8 (patch) | |
tree | 7e4982e778e3a01b5815c760240ab98d02ea3344 | |
parent | 380035a4a9580528031a9c25b8a3bbdb9bd47631 (diff) | |
download | gst-plugins-ugly0-10-37376663aef30f59f9a4af509691359b99501ae8.tar.gz gst-plugins-ugly0-10-37376663aef30f59f9a4af509691359b99501ae8.tar.xz gst-plugins-ugly0-10-37376663aef30f59f9a4af509691359b99501ae8.zip |
amrnbdec: _parse should not return OK if not enough data yet
-rw-r--r-- | ext/amrnb/amrnbdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/amrnb/amrnbdec.c b/ext/amrnb/amrnbdec.c index 5f6c64b3..bf59d8de 100644 --- a/ext/amrnb/amrnbdec.c +++ b/ext/amrnb/amrnbdec.c | |||
@@ -257,7 +257,7 @@ gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, | |||
257 | gst_audio_decoder_get_parse_state (dec, &sync, &eos); | 257 | gst_audio_decoder_get_parse_state (dec, &sync, &eos); |
258 | 258 | ||
259 | /* need to peek data to get the size */ | 259 | /* need to peek data to get the size */ |
260 | if (gst_adapter_available (adapter) < 1) | 260 | if (size < 1) |
261 | return GST_FLOW_ERROR; | 261 | return GST_FLOW_ERROR; |
262 | 262 | ||
263 | data = gst_adapter_peek (adapter, 1); | 263 | data = gst_adapter_peek (adapter, 1); |
@@ -280,6 +280,9 @@ gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, | |||
280 | 280 | ||
281 | GST_DEBUG_OBJECT (amrnbdec, "mode %d, block %d", mode, block); | 281 | GST_DEBUG_OBJECT (amrnbdec, "mode %d, block %d", mode, block); |
282 | 282 | ||
283 | if (block > size) | ||
284 | return GST_FLOW_UNEXPECTED; | ||
285 | |||
283 | *offset = 0; | 286 | *offset = 0; |
284 | *length = block; | 287 | *length = block; |
285 | 288 | ||