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
68a35473
Commit
68a35473
authored
Nov 09, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4xm: more thorought check for negative index and negative shift
CC: libav-stable@libav.org Bug-Id: CID 1087094
parent
c9c7d59b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
4xm.c
libavcodec/4xm.c
+18
-11
No files found.
libavcodec/4xm.c
View file @
68a35473
...
...
@@ -340,22 +340,29 @@ static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w,
static
int
decode_p_block
(
FourXContext
*
f
,
uint16_t
*
dst
,
uint16_t
*
src
,
int
log2w
,
int
log2h
,
int
stride
)
{
const
int
index
=
size2index
[
log2h
][
log2w
];
const
int
h
=
1
<<
log2h
;
int
code
=
get_vlc2
(
&
f
->
gb
,
block_type_vlc
[
1
-
(
f
->
version
>
1
)][
index
].
table
,
BLOCK_TYPE_VLC_BITS
,
1
);
uint16_t
*
start
=
f
->
last_frame_buffer
;
uint16_t
*
end
=
start
+
stride
*
(
f
->
avctx
->
height
-
h
+
1
)
-
(
1
<<
log2w
);
int
ret
;
int
scale
=
1
;
int
index
,
h
,
code
,
ret
,
scale
=
1
;
uint16_t
*
start
,
*
end
;
unsigned
dc
=
0
;
if
(
code
<
0
||
code
>
6
||
log2w
<
0
)
if
(
log2h
<
0
||
log2w
<
0
)
return
AVERROR_INVALIDDATA
;
index
=
size2index
[
log2h
][
log2w
];
if
(
index
<
0
)
return
AVERROR_INVALIDDATA
;
h
=
1
<<
log2h
;
code
=
get_vlc2
(
&
f
->
gb
,
block_type_vlc
[
1
-
(
f
->
version
>
1
)][
index
].
table
,
BLOCK_TYPE_VLC_BITS
,
1
);
if
(
code
<
0
||
code
>
6
)
return
AVERROR_INVALIDDATA
;
start
=
f
->
last_frame_buffer
;
end
=
start
+
stride
*
(
f
->
avctx
->
height
-
h
+
1
)
-
(
1
<<
log2w
);
if
(
code
==
1
)
{
log2h
--
;
if
(
--
log2h
<
0
)
return
AVERROR_INVALIDDATA
;
if
((
ret
=
decode_p_block
(
f
,
dst
,
src
,
log2w
,
log2h
,
stride
))
<
0
)
return
ret
;
return
decode_p_block
(
f
,
dst
+
(
stride
<<
log2h
),
...
...
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