mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
wavparse: guard against overflow when comparing chunk sizes
Could be rewritten as lsize > (size - 8) a well, but the extra check seems clearer. Doesn't look like it was problematic, lsize wasn't actually used when parsing the sub-chunks. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/994>
This commit is contained in:
parent
4f2189a6e1
commit
3dd8de1d7c
1 changed files with 1 additions and 1 deletions
|
@ -930,7 +930,7 @@ gst_wavparse_adtl_chunk (GstWavParse * wav, const guint8 * data, guint32 size)
|
|||
ltag = GST_READ_UINT32_LE (data + offset);
|
||||
lsize = GST_READ_UINT32_LE (data + offset + 4);
|
||||
|
||||
if (lsize + 8 > size) {
|
||||
if (lsize > (G_MAXUINT - 8) || lsize + 8 > size) {
|
||||
GST_WARNING_OBJECT (wav, "Invalid adtl size: %u + 8 > %u", lsize, size);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue