Commit 8b2a6a8c authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

flactag: Fix possible NULL pointer dereference

parent 711e0cc9
...@@ -364,6 +364,8 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer) ...@@ -364,6 +364,8 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer)
if (buffer == NULL) { if (buffer == NULL) {
GST_ELEMENT_ERROR (tag, CORE, TOO_LAZY, (NULL), GST_ELEMENT_ERROR (tag, CORE, TOO_LAZY, (NULL),
("Error creating 12-byte buffer for padding block")); ("Error creating 12-byte buffer for padding block"));
ret = GST_FLOW_ERROR;
goto cleanup;
} }
memset (GST_BUFFER_DATA (buffer), 0, GST_BUFFER_SIZE (buffer)); memset (GST_BUFFER_DATA (buffer), 0, GST_BUFFER_SIZE (buffer));
GST_BUFFER_DATA (buffer)[0] = 0x81; /* 0x80 = Last metadata block, GST_BUFFER_DATA (buffer)[0] = 0x81; /* 0x80 = Last metadata block,
...@@ -383,6 +385,7 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer) ...@@ -383,6 +385,7 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer)
if (buffer == NULL) { if (buffer == NULL) {
GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL), GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL),
("Error converting tag list to vorbiscomment buffer")); ("Error converting tag list to vorbiscomment buffer"));
ret = GST_FLOW_ERROR;
goto cleanup; goto cleanup;
} }
size = GST_BUFFER_SIZE (buffer) - 4; size = GST_BUFFER_SIZE (buffer) - 4;
...@@ -393,6 +396,7 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer) ...@@ -393,6 +396,7 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer)
*/ */
GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL), GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL),
("Vorbis comment of size %d too long", size)); ("Vorbis comment of size %d too long", size));
ret = GST_FLOW_ERROR;
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment