Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
f44e5e63
Commit
f44e5e63
authored
Jun 16, 2010
by
Sebastian Dröge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ebml-read: Zero-sized ints/uints/floats have a value of 0 according to the EBML spec
parent
e4a5f091
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
gst/matroska/ebml-read.c
gst/matroska/ebml-read.c
+18
-4
No files found.
gst/matroska/ebml-read.c
View file @
f44e5e63
...
...
@@ -394,13 +394,19 @@ gst_ebml_read_uint (GstEbmlRead * ebml, guint32 * id, guint64 * num)
if
(
ret
!=
GST_FLOW_OK
)
return
ret
;
if
(
size
<
1
||
size
>
8
)
{
if
(
size
>
8
)
{
GST_ERROR_OBJECT
(
ebml
->
el
,
"Invalid integer element size %d at position %"
G_GUINT64_FORMAT
" (0x%"
G_GINT64_MODIFIER
"x)"
,
size
,
gst_ebml_read_get_pos
(
ebml
)
-
size
,
gst_ebml_read_get_pos
(
ebml
)
-
size
);
return
GST_FLOW_ERROR
;
}
if
(
size
==
0
)
{
*
num
=
0
;
return
ret
;
}
*
num
=
0
;
while
(
size
>
0
)
{
*
num
=
(
*
num
<<
8
)
|
*
data
;
...
...
@@ -427,7 +433,7 @@ gst_ebml_read_sint (GstEbmlRead * ebml, guint32 * id, gint64 * num)
if
(
ret
!=
GST_FLOW_OK
)
return
ret
;
if
(
size
<
1
||
size
>
8
)
{
if
(
size
>
8
)
{
GST_ERROR_OBJECT
(
ebml
->
el
,
"Invalid integer element size %d at position %"
G_GUINT64_FORMAT
" (0x%"
G_GINT64_MODIFIER
"x)"
,
size
,
gst_ebml_read_get_pos
(
ebml
)
-
size
,
...
...
@@ -435,6 +441,11 @@ gst_ebml_read_sint (GstEbmlRead * ebml, guint32 * id, gint64 * num)
return
GST_FLOW_ERROR
;
}
if
(
size
==
0
)
{
*
num
=
0
;
return
ret
;
}
*
num
=
0
;
if
(
*
data
&
0x80
)
{
negative
=
1
;
...
...
@@ -505,7 +516,7 @@ gst_ebml_read_float (GstEbmlRead * ebml, guint32 * id, gdouble * num)
if
(
ret
!=
GST_FLOW_OK
)
return
ret
;
if
(
size
!=
4
&&
size
!=
8
&&
size
!=
10
)
{
if
(
size
!=
0
&&
size
!=
4
&&
size
!=
8
&&
size
!=
10
)
{
GST_ERROR_OBJECT
(
ebml
->
el
,
"Invalid float element size %d at position %"
G_GUINT64_FORMAT
" (0x%"
G_GINT64_MODIFIER
"x)"
,
size
,
gst_ebml_read_get_pos
(
ebml
)
-
size
,
...
...
@@ -527,8 +538,11 @@ gst_ebml_read_float (GstEbmlRead * ebml, guint32 * id, gdouble * num)
d
=
GDOUBLE_FROM_BE
(
d
);
*
num
=
d
;
}
else
{
}
else
if
(
size
==
10
)
{
*
num
=
_ext2dbl
(
data
);
}
else
{
/* size == 0 means a value of 0.0 */
*
num
=
0
.
0
;
}
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment