projects
/
platform
/
upstream
/
gst-plugins-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b5d97e
)
typefind: Use GST_READ_UINT32 macros
author
Edward Hervey
<edward@centricular.com>
Mon, 30 Oct 2017 10:10:11 +0000
(11:10 +0100)
committer
Edward Hervey
<bilboed@bilboed.com>
Mon, 30 Oct 2017 10:10:11 +0000
(11:10 +0100)
Avoids undefined behaviour with shifting
gst/typefind/gsttypefindfunctions.c
patch
|
blob
|
history
diff --git
a/gst/typefind/gsttypefindfunctions.c
b/gst/typefind/gsttypefindfunctions.c
index
c9a2c75
..
839ee4f
100644
(file)
--- a/
gst/typefind/gsttypefindfunctions.c
+++ b/
gst/typefind/gsttypefindfunctions.c
@@
-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;