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
9e1db721
Commit
9e1db721
authored
Feb 10, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svq3: Prevent illegal reads while parsing extradata.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
parent
b24aaabd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
svq3.c
libavcodec/svq3.c
+14
-5
No files found.
libavcodec/svq3.c
View file @
9e1db721
...
@@ -811,7 +811,9 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
...
@@ -811,7 +811,9 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
MpegEncContext
*
s
=
&
h
->
s
;
MpegEncContext
*
s
=
&
h
->
s
;
int
m
;
int
m
;
unsigned
char
*
extradata
;
unsigned
char
*
extradata
;
unsigned
char
*
extradata_end
;
unsigned
int
size
;
unsigned
int
size
;
int
marker_found
=
0
;
if
(
ff_h264_decode_init
(
avctx
)
<
0
)
if
(
ff_h264_decode_init
(
avctx
)
<
0
)
return
-
1
;
return
-
1
;
...
@@ -831,19 +833,26 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
...
@@ -831,19 +833,26 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
/* prowl for the "SEQH" marker in the extradata */
/* prowl for the "SEQH" marker in the extradata */
extradata
=
(
unsigned
char
*
)
avctx
->
extradata
;
extradata
=
(
unsigned
char
*
)
avctx
->
extradata
;
for
(
m
=
0
;
m
<
avctx
->
extradata_size
;
m
++
)
{
extradata_end
=
avctx
->
extradata
+
avctx
->
extradata_size
;
if
(
!
memcmp
(
extradata
,
"SEQH"
,
4
))
if
(
extradata
)
{
for
(
m
=
0
;
m
+
8
<
avctx
->
extradata_size
;
m
++
)
{
if
(
!
memcmp
(
extradata
,
"SEQH"
,
4
))
{
marker_found
=
1
;
break
;
break
;
}
extradata
++
;
extradata
++
;
}
}
}
/* if a match was found, parse the extra data */
/* if a match was found, parse the extra data */
if
(
extradata
&&
!
memcmp
(
extradata
,
"SEQH"
,
4
)
)
{
if
(
marker_found
)
{
GetBitContext
gb
;
GetBitContext
gb
;
int
frame_size_code
;
int
frame_size_code
;
size
=
AV_RB32
(
&
extradata
[
4
]);
size
=
AV_RB32
(
&
extradata
[
4
]);
if
(
size
>
extradata_end
-
extradata
-
8
)
return
AVERROR_INVALIDDATA
;
init_get_bits
(
&
gb
,
extradata
+
8
,
size
*
8
);
init_get_bits
(
&
gb
,
extradata
+
8
,
size
*
8
);
/* 'frame size code' and optional 'width, height' */
/* 'frame size code' and optional 'width, height' */
...
...
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