Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
696ace50
Commit
696ace50
authored
Jan 05, 2012
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truemotion2: check size before GetBitContext initialisation
Prevents null ptr derefence for negative sizes.
parent
acb07430
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
truemotion2.c
libavcodec/truemotion2.c
+6
-0
No files found.
libavcodec/truemotion2.c
View file @
696ace50
...
...
@@ -272,6 +272,8 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
len
=
AV_RB32
(
buf
);
buf
+=
4
;
cur
+=
4
;
}
if
(
len
>
0
)
{
if
(
skip
<=
cur
)
return
-
1
;
init_get_bits
(
&
ctx
->
gb
,
buf
,
(
skip
-
cur
)
*
8
);
if
(
tm2_read_deltas
(
ctx
,
stream_id
)
==
-
1
)
return
-
1
;
...
...
@@ -286,6 +288,8 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
buf
+=
4
;
cur
+=
4
;
buf
+=
4
;
cur
+=
4
;
/* unused by decoder */
if
(
skip
<=
cur
)
return
-
1
;
init_get_bits
(
&
ctx
->
gb
,
buf
,
(
skip
-
cur
)
*
8
);
if
(
tm2_build_huff_table
(
ctx
,
&
codes
)
==
-
1
)
return
-
1
;
...
...
@@ -303,6 +307,8 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
ctx
->
tok_lens
[
stream_id
]
=
toks
;
len
=
AV_RB32
(
buf
);
buf
+=
4
;
cur
+=
4
;
if
(
len
>
0
)
{
if
(
skip
<=
cur
)
return
-
1
;
init_get_bits
(
&
ctx
->
gb
,
buf
,
(
skip
-
cur
)
*
8
);
for
(
i
=
0
;
i
<
toks
;
i
++
)
{
if
(
get_bits_left
(
&
ctx
->
gb
)
<=
0
)
{
...
...
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