Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
42a1f1d7
Commit
42a1f1d7
authored
Dec 30, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid uninitialized data in lcldec when ofs is 0 in MSZH.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
4962edf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lcldec.c
libavcodec/lcldec.c
+7
-1
lzo.h
libavutil/lzo.h
+0
-3
No files found.
libavcodec/lcldec.c
View file @
42a1f1d7
...
@@ -96,7 +96,13 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
...
@@ -96,7 +96,13 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
ofs
=
FFMIN
(
ofs
,
destptr
-
destptr_bak
);
ofs
=
FFMIN
(
ofs
,
destptr
-
destptr_bak
);
cnt
*=
4
;
cnt
*=
4
;
cnt
=
FFMIN
(
cnt
,
destptr_end
-
destptr
);
cnt
=
FFMIN
(
cnt
,
destptr_end
-
destptr
);
av_memcpy_backptr
(
destptr
,
ofs
,
cnt
);
if
(
ofs
)
{
av_memcpy_backptr
(
destptr
,
ofs
,
cnt
);
}
else
{
// Not known what the correct behaviour is, but
// this at least avoids uninitialized data.
memset
(
destptr
,
0
,
cnt
);
}
destptr
+=
cnt
;
destptr
+=
cnt
;
}
}
maskbit
>>=
1
;
maskbit
>>=
1
;
...
...
libavutil/lzo.h
View file @
42a1f1d7
...
@@ -67,9 +67,6 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
...
@@ -67,9 +67,6 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
*
*
* cnt > back is valid, this will copy the bytes we just copied,
* cnt > back is valid, this will copy the bytes we just copied,
* thus creating a repeating pattern with a period length of back.
* thus creating a repeating pattern with a period length of back.
* Note that lcldec currently can set back == 0 - which is wrong and
* makes no sense, but the code should at least avoid crashing or hanging
* for this case.
*/
*/
void
av_memcpy_backptr
(
uint8_t
*
dst
,
int
back
,
int
cnt
);
void
av_memcpy_backptr
(
uint8_t
*
dst
,
int
back
,
int
cnt
);
...
...
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