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
2e0141c3
Commit
2e0141c3
authored
Jul 05, 2006
by
Stefan Gehrer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
even more cbp safety
Originally committed as revision 5627 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0e9b7305
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
cavs.c
libavcodec/cavs.c
+10
-13
No files found.
libavcodec/cavs.c
View file @
2e0141c3
...
...
@@ -869,7 +869,7 @@ static inline int next_mb(AVSContext *h) {
return
1
;
}
static
int
decode_mb_i
(
AVSContext
*
h
)
{
static
int
decode_mb_i
(
AVSContext
*
h
,
int
cbp_code
)
{
GetBitContext
*
gb
=
&
h
->
s
.
gb
;
int
block
,
pred_mode_uv
;
uint8_t
top
[
18
];
...
...
@@ -919,14 +919,13 @@ static int decode_mb_i(AVSContext *h) {
}
/* get coded block pattern */
if
(
h
->
pic_type
==
FF_I_TYPE
){
int
cbp
=
get_ue_golomb
(
gb
);
if
(
cbp
>
63
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"illegal intra cbp
\n
"
);
return
-
1
;
}
h
->
cbp
=
cbp_tab
[
cbp
][
0
];
if
(
h
->
pic_type
==
FF_I_TYPE
)
cbp_code
=
get_ue_golomb
(
gb
);
if
(
cbp_code
>
63
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"illegal intra cbp
\n
"
);
return
-
1
;
}
h
->
cbp
=
cbp_tab
[
cbp_code
][
0
];
if
(
h
->
cbp
&&
!
h
->
qp_fixed
)
h
->
qp
+=
get_se_golomb
(
gb
);
//qp_delta
...
...
@@ -1270,7 +1269,7 @@ static int decode_pic(AVSContext *h) {
check_for_slice
(
h
);
if
(
h
->
pic_type
==
FF_I_TYPE
)
{
do
{
decode_mb_i
(
h
);
decode_mb_i
(
h
,
0
);
}
while
(
next_mb
(
h
));
}
else
if
(
h
->
pic_type
==
FF_P_TYPE
)
{
do
{
...
...
@@ -1285,8 +1284,7 @@ static int decode_pic(AVSContext *h) {
}
else
mb_type
=
get_ue_golomb
(
&
s
->
gb
)
+
P_SKIP
;
if
(
mb_type
>
P_8X8
)
{
h
->
cbp
=
cbp_tab
[
mb_type
-
P_8X8
-
1
][
0
];
decode_mb_i
(
h
);
decode_mb_i
(
h
,
mb_type
-
P_8X8
-
1
);
}
else
decode_mb_p
(
h
,
mb_type
);
}
while
(
next_mb
(
h
));
...
...
@@ -1303,8 +1301,7 @@ static int decode_pic(AVSContext *h) {
}
else
mb_type
=
get_ue_golomb
(
&
s
->
gb
)
+
B_SKIP
;
if
(
mb_type
>
B_8X8
)
{
h
->
cbp
=
cbp_tab
[
mb_type
-
B_8X8
-
1
][
0
];
decode_mb_i
(
h
);
decode_mb_i
(
h
,
mb_type
-
B_8X8
-
1
);
}
else
decode_mb_b
(
h
,
mb_type
);
}
while
(
next_mb
(
h
));
...
...
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