Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Traud
Opus
Commits
259e1666
Commit
259e1666
authored
12 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Fix packet length handling for 16-bit machines (makes no difference on 32-bit)
parent
54f7cb46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/opus_decoder.c
+6
-4
6 additions, 4 deletions
src/opus_decoder.c
with
6 additions
and
4 deletions
src/opus_decoder.c
+
6
−
4
View file @
259e1666
...
@@ -589,7 +589,7 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
...
@@ -589,7 +589,7 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
int
cbr
;
int
cbr
;
unsigned
char
ch
,
toc
;
unsigned
char
ch
,
toc
;
int
framesize
;
int
framesize
;
int
last_size
;
opus_
int
32
last_size
;
const
unsigned
char
*
data0
=
data
;
const
unsigned
char
*
data0
=
data
;
if
(
size
==
NULL
)
if
(
size
==
NULL
)
...
@@ -615,7 +615,9 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
...
@@ -615,7 +615,9 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
{
{
if
(
len
&
0x1
)
if
(
len
&
0x1
)
return
OPUS_INVALID_PACKET
;
return
OPUS_INVALID_PACKET
;
size
[
0
]
=
last_size
=
len
/
2
;
last_size
=
len
/
2
;
/* If last_size doesn't fit in size[0], we'll catch it later */
size
[
0
]
=
(
short
)
last_size
;
}
}
break
;
break
;
/* Two VBR frames */
/* Two VBR frames */
...
@@ -676,7 +678,7 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
...
@@ -676,7 +678,7 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
if
(
last_size
*
count
!=
len
)
if
(
last_size
*
count
!=
len
)
return
OPUS_INVALID_PACKET
;
return
OPUS_INVALID_PACKET
;
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
size
[
i
]
=
last_size
;
size
[
i
]
=
(
short
)
last_size
;
}
}
break
;
break
;
}
}
...
@@ -704,7 +706,7 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
...
@@ -704,7 +706,7 @@ static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
1275. Reject them here.*/
1275. Reject them here.*/
if
(
last_size
>
1275
)
if
(
last_size
>
1275
)
return
OPUS_INVALID_PACKET
;
return
OPUS_INVALID_PACKET
;
size
[
count
-
1
]
=
last_size
;
size
[
count
-
1
]
=
(
short
)
last_size
;
}
}
if
(
frames
)
if
(
frames
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment