Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Speex
Commits
9e349c1d
Commit
9e349c1d
authored
Dec 06, 2013
by
Ron
Committed by
Tristan Matthews
Dec 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check the size of the header packet before we look inside it
Signed-off-by:
Tristan Matthews
<
le.businessman@gmail.com
>
parent
ca7cfdbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
libspeex/speex_header.c
libspeex/speex_header.c
+10
-8
No files found.
libspeex/speex_header.c
View file @
9e349c1d
...
...
@@ -147,20 +147,22 @@ EXPORT SpeexHeader *speex_packet_to_header(char *packet, int size)
int
i
;
SpeexHeader
*
le_header
;
const
char
*
h
=
"Speex "
;
for
(
i
=
0
;
i
<
8
;
i
++
)
if
(
packet
[
i
]
!=
h
[
i
])
{
speex_notify
(
"This doesn't look like a Speex file"
);
return
NULL
;
}
/*FIXME: Do we allow larger headers?*/
if
(
size
<
(
int
)
sizeof
(
SpeexHeader
))
{
speex_notify
(
"Speex header too small"
);
return
NULL
;
}
for
(
i
=
0
;
i
<
8
;
i
++
)
if
(
packet
[
i
]
!=
h
[
i
])
{
speex_notify
(
"This doesn't look like a Speex file"
);
return
NULL
;
}
le_header
=
(
SpeexHeader
*
)
speex_alloc
(
sizeof
(
SpeexHeader
));
SPEEX_COPY
(
le_header
,
(
SpeexHeader
*
)
packet
,
1
);
...
...
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