mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
[MOVED FROM BAD 19/57] gst/flv/gstflvparse.c: Handle NULL returns from FLV_GET_STRING() more gracefully. Fixes crash caused by a strlen on a...
Original commit message from CVS: * gst/flv/gstflvparse.c: (gst_flv_parse_metadata_item), (gst_flv_parse_tag_script): Handle NULL returns from FLV_GET_STRING() more gracefully. Fixes crash caused by a strlen on a NULL string (#527622).
This commit is contained in:
parent
71e48aa5d7
commit
7104ffa7dc
1 changed files with 8 additions and 3 deletions
|
@ -178,6 +178,9 @@ gst_flv_parse_metadata_item (GstFLVDemux * demux, const guint8 * data,
|
||||||
|
|
||||||
value = FLV_GET_STRING (data + offset, data_size - offset);
|
value = FLV_GET_STRING (data + offset, data_size - offset);
|
||||||
|
|
||||||
|
if (value == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
offset += strlen (value) + 2;
|
offset += strlen (value) + 2;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "%s => (string) %s", tag_name, value);
|
GST_DEBUG_OBJECT (demux, "%s => (string) %s", tag_name, value);
|
||||||
|
@ -329,12 +332,14 @@ gst_flv_parse_tag_script (GstFLVDemux * demux, const guint8 * data,
|
||||||
GST_LOG_OBJECT (demux, "parsing a script tag");
|
GST_LOG_OBJECT (demux, "parsing a script tag");
|
||||||
|
|
||||||
if (GST_READ_UINT8 (data + offset++) == 2) {
|
if (GST_READ_UINT8 (data + offset++) == 2) {
|
||||||
|
gchar *function_name;
|
||||||
guint i;
|
guint i;
|
||||||
gchar *function_name = FLV_GET_STRING (data + offset, data_size - offset);
|
|
||||||
|
|
||||||
GST_LOG_OBJECT (demux, "function name is %s", function_name);
|
function_name = FLV_GET_STRING (data + offset, data_size - offset);
|
||||||
|
|
||||||
if (!strcmp (function_name, "onMetaData")) {
|
GST_LOG_OBJECT (demux, "function name is %s", GST_STR_NULL (function_name));
|
||||||
|
|
||||||
|
if (function_name != NULL && strcmp (function_name, "onMetaData") == 0) {
|
||||||
guint32 nb_elems = 0;
|
guint32 nb_elems = 0;
|
||||||
gboolean end_marker = FALSE;
|
gboolean end_marker = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue