mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
tags: Don't allow image tags with G_MAXUINT32 length
This will cause an integer overflow a little bit further down because we allocate a bit more memory to allow for a NUL-terminator. The caller should've avoided passing that much data in already as it's not going to be a valid image and there's likely not even that much data available. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4894>
This commit is contained in:
parent
dbbfc917fe
commit
3144f63302
1 changed files with 2 additions and 1 deletions
|
@ -530,7 +530,8 @@ gst_tag_image_data_to_image_sample (const guint8 * image_data,
|
|||
GstStructure *image_info = NULL;
|
||||
|
||||
g_return_val_if_fail (image_data != NULL, NULL);
|
||||
g_return_val_if_fail (image_data_len > 0, NULL);
|
||||
g_return_val_if_fail (image_data_len > 0
|
||||
|| image_data_len == G_MAXUINT32, NULL);
|
||||
g_return_val_if_fail (gst_tag_image_type_is_valid (image_type), NULL);
|
||||
|
||||
GST_DEBUG ("image data len: %u bytes", image_data_len);
|
||||
|
|
Loading…
Reference in a new issue