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
Container Registry
Model registry
Operate
Environments
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
Xiph.Org
Opus
Commits
a1bb9c70
Commit
a1bb9c70
authored
16 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Error detection in uint decoding (can no longer return an int that's out
of range.
parent
eaeb0b77
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
libcelt/entdec.c
+15
-3
15 additions, 3 deletions
libcelt/entdec.c
with
15 additions
and
3 deletions
libcelt/entdec.c
+
15
−
3
View file @
a1bb9c70
...
...
@@ -4,7 +4,7 @@
#include
<stddef.h>
#include
"entdec.h"
#include
"os_support.h"
void
ec_byte_readinit
(
ec_byte_buffer
*
_b
,
unsigned
char
*
_buf
,
long
_bytes
){
...
...
@@ -124,7 +124,13 @@ ec_uint32 ec_dec_uint(ec_dec *_this,ec_uint32 _ft){
s
=
ec_decode
(
_this
,
ft
);
ec_dec_update
(
_this
,
s
,
s
+
1
,
ft
);
t
=
t
<<
EC_UNIT_BITS
|
s
;
return
t
<<
ftb
|
ec_dec_bits
(
_this
,
ftb
);
t
=
t
<<
ftb
|
ec_dec_bits
(
_this
,
ftb
);
if
(
t
>
_ft
)
{
celt_notify
(
"uint decode error"
);
t
=
_ft
;
}
return
t
;
}
else
{
_ft
++
;
s
=
ec_decode
(
_this
,(
unsigned
)
_ft
);
...
...
@@ -148,7 +154,13 @@ ec_uint64 ec_dec_uint64(ec_dec *_this,ec_uint64 _ft){
s
=
ec_decode
(
_this
,
ft
);
ec_dec_update
(
_this
,
s
,
s
+
1
,
ft
);
t
=
t
<<
EC_UNIT_BITS
|
s
;
return
t
<<
ftb
|
ec_dec_bits64
(
_this
,
ftb
);
t
=
t
<<
ftb
|
ec_dec_bits64
(
_this
,
ftb
);
if
(
t
>
_ft
)
{
celt_notify
(
"uint decode error"
);
t
=
_ft
;
}
return
t
;
}
else
{
_ft
++
;
s
=
ec_decode
(
_this
,(
unsigned
)
_ft
);
...
...
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