Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
5e038b4f
Commit
5e038b4f
authored
Feb 01, 2008
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LZO decoder input is const
Originally committed as revision 11797 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c67102f9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lzo.c
libavutil/lzo.c
+5
-5
lzo.h
libavutil/lzo.h
+1
-1
No files found.
libavutil/lzo.c
View file @
5e038b4f
...
...
@@ -29,7 +29,7 @@
//! define if we may read up to 8 bytes beyond the input buffer
#define INBUF_PADDED 1
typedef
struct
LZOContext
{
uint8_t
*
in
,
*
in_end
;
const
uint8_t
*
in
,
*
in_end
;
uint8_t
*
out_start
,
*
out
,
*
out_end
;
int
error
;
}
LZOContext
;
...
...
@@ -84,7 +84,7 @@ static inline int get_len(LZOContext *c, int x, int mask) {
* \param cnt number of bytes to copy, must be >= 0
*/
static
inline
void
copy
(
LZOContext
*
c
,
int
cnt
)
{
register
uint8_t
*
src
=
c
->
in
;
register
const
uint8_t
*
src
=
c
->
in
;
register
uint8_t
*
dst
=
c
->
out
;
if
(
cnt
>
c
->
in_end
-
src
)
{
cnt
=
FFMAX
(
c
->
in_end
-
src
,
0
);
...
...
@@ -115,7 +115,7 @@ static inline void copy(LZOContext *c, int cnt) {
* thus creating a repeating pattern with a period length of back.
*/
static
inline
void
copy_backptr
(
LZOContext
*
c
,
int
back
,
int
cnt
)
{
register
uint8_t
*
src
=
&
c
->
out
[
-
back
];
register
const
uint8_t
*
src
=
&
c
->
out
[
-
back
];
register
uint8_t
*
dst
=
c
->
out
;
if
(
src
<
c
->
out_start
||
src
>
dst
)
{
c
->
error
|=
LZO_INVALID_BACKPTR
;
...
...
@@ -171,12 +171,12 @@ static inline void copy_backptr(LZOContext *c, int back, int cnt) {
* make sure all buffers are appropriately padded, in must provide
* LZO_INPUT_PADDING, out must provide LZO_OUTPUT_PADDING additional bytes
*/
int
lzo1x_decode
(
void
*
out
,
int
*
outlen
,
void
*
in
,
int
*
inlen
)
{
int
lzo1x_decode
(
void
*
out
,
int
*
outlen
,
const
void
*
in
,
int
*
inlen
)
{
int
state
=
0
;
int
x
;
LZOContext
c
;
c
.
in
=
in
;
c
.
in_end
=
(
uint8_t
*
)
in
+
*
inlen
;
c
.
in_end
=
(
const
uint8_t
*
)
in
+
*
inlen
;
c
.
out
=
c
.
out_start
=
out
;
c
.
out_end
=
(
uint8_t
*
)
out
+
*
outlen
;
c
.
error
=
0
;
...
...
libavutil/lzo.h
View file @
5e038b4f
...
...
@@ -30,6 +30,6 @@
#define LZO_INPUT_PADDING 8
#define LZO_OUTPUT_PADDING 12
int
lzo1x_decode
(
void
*
out
,
int
*
outlen
,
void
*
in
,
int
*
inlen
);
int
lzo1x_decode
(
void
*
out
,
int
*
outlen
,
const
void
*
in
,
int
*
inlen
);
#endif
/* FFMPEG_LZO_H */
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