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
b64269ce
Commit
b64269ce
authored
Sep 21, 2011
by
Laurent Aimar
Committed by
Michael Niedermayer
Sep 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for invalid slices offsets in RV30/40 decoder.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
741ec30b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
rv34.c
libavcodec/rv34.c
+10
-1
No files found.
libavcodec/rv34.c
View file @
b64269ce
...
...
@@ -1517,13 +1517,18 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
else
size
=
get_slice_offset
(
avctx
,
slices_hdr
,
i
+
1
)
-
offset
;
if
(
offset
<
0
||
offset
>
buf_size
||
size
<
0
){
if
(
offset
<
0
||
offset
>
buf_size
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Slice offset is invalid
\n
"
);
break
;
}
r
->
si
.
end
=
s
->
mb_width
*
s
->
mb_height
;
if
(
i
+
1
<
slice_count
){
if
(
get_slice_offset
(
avctx
,
slices_hdr
,
i
+
1
)
<
0
||
get_slice_offset
(
avctx
,
slices_hdr
,
i
+
1
)
>
buf_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Slice offset is invalid
\n
"
);
break
;
}
init_get_bits
(
&
s
->
gb
,
buf
+
get_slice_offset
(
avctx
,
slices_hdr
,
i
+
1
),
(
buf_size
-
get_slice_offset
(
avctx
,
slices_hdr
,
i
+
1
))
*
8
);
if
(
r
->
parse_slice_header
(
r
,
&
r
->
s
.
gb
,
&
si
)
<
0
){
if
(
i
+
2
<
slice_count
)
...
...
@@ -1533,6 +1538,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
}
else
r
->
si
.
end
=
si
.
start
;
}
if
(
size
<
0
||
size
>
buf_size
-
offset
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Slice size is invalid
\n
"
);
break
;
}
last
=
rv34_decode_slice
(
r
,
r
->
si
.
end
,
buf
+
offset
,
size
);
s
->
mb_num_left
=
r
->
s
.
mb_x
+
r
->
s
.
mb_y
*
r
->
s
.
mb_width
-
r
->
si
.
start
;
if
(
last
)
...
...
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