mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
typefind: Use GST_READ_UINT32 macros
Avoids undefined behaviour with shifting
This commit is contained in:
parent
7b5d97e9c3
commit
5bcc1e2b57
1 changed files with 2 additions and 2 deletions
|
@ -264,9 +264,9 @@ check_utf32 (const guint8 * data, gint len, gint endianness)
|
|||
while (len > 3) {
|
||||
guint32 v;
|
||||
if (endianness == G_BIG_ENDIAN)
|
||||
v = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];
|
||||
v = GST_READ_UINT32_BE (data);
|
||||
else
|
||||
v = (data[3] << 24) | (data[2] << 16) | (data[1] << 8) | data[0];
|
||||
v = GST_READ_UINT32_LE (data);
|
||||
if (v >= 0x10FFFF)
|
||||
return FALSE;
|
||||
data += 4;
|
||||
|
|
Loading…
Reference in a new issue