matroska: fix check for amount of data to read

History shows length==0 should set data to NULL and return,
so we do that too instead of trying to read nothing.

Coverity 206205
This commit is contained in:
Vincent Penquerc'h 2014-04-16 17:29:30 +01:00
parent 46a39bdd4f
commit 457712b933

View file

@ -377,7 +377,7 @@ gst_ebml_read_bytes (GstEbmlRead * ebml, guint32 * id, const guint8 ** data,
return GST_FLOW_ERROR; /* FIXME: do proper error handling */
*data = NULL;
if (G_LIKELY (length >= 0)) {
if (G_LIKELY (length > 0)) {
if (!gst_byte_reader_get_data (gst_ebml_read_br (ebml), length, data))
return GST_FLOW_PARSE;
}