Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
643326f7
Commit
643326f7
authored
Jul 14, 2006
by
Stefan Gehrer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid overflows of qp and pic_type
Originally committed as revision 5746 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3409385d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
cavs.c
libavcodec/cavs.c
+6
-2
No files found.
libavcodec/cavs.c
View file @
643326f7
...
@@ -716,7 +716,7 @@ static inline int decode_residual_inter(AVSContext *h) {
...
@@ -716,7 +716,7 @@ static inline int decode_residual_inter(AVSContext *h) {
/* get quantizer */
/* get quantizer */
if
(
h
->
cbp
&&
!
h
->
qp_fixed
)
if
(
h
->
cbp
&&
!
h
->
qp_fixed
)
h
->
qp
+=
get_se_golomb
(
&
h
->
s
.
gb
)
;
h
->
qp
=
(
h
->
qp
+
get_se_golomb
(
&
h
->
s
.
gb
))
&
63
;
for
(
block
=
0
;
block
<
4
;
block
++
)
for
(
block
=
0
;
block
<
4
;
block
++
)
if
(
h
->
cbp
&
(
1
<<
block
))
if
(
h
->
cbp
&
(
1
<<
block
))
decode_residual_block
(
h
,
&
h
->
s
.
gb
,
inter_2dvlc
,
0
,
h
->
qp
,
decode_residual_block
(
h
,
&
h
->
s
.
gb
,
inter_2dvlc
,
0
,
h
->
qp
,
...
@@ -876,7 +876,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
...
@@ -876,7 +876,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
}
}
h
->
cbp
=
cbp_tab
[
cbp_code
][
0
];
h
->
cbp
=
cbp_tab
[
cbp_code
][
0
];
if
(
h
->
cbp
&&
!
h
->
qp_fixed
)
if
(
h
->
cbp
&&
!
h
->
qp_fixed
)
h
->
qp
+=
get_se_golomb
(
gb
)
;
//qp_delta
h
->
qp
=
(
h
->
qp
+
get_se_golomb
(
gb
))
&
63
;
//qp_delta
/* luma intra prediction interleaved with residual decode/transform/add */
/* luma intra prediction interleaved with residual decode/transform/add */
for
(
block
=
0
;
block
<
4
;
block
++
)
{
for
(
block
=
0
;
block
<
4
;
block
++
)
{
...
@@ -1154,6 +1154,10 @@ static int decode_pic(AVSContext *h) {
...
@@ -1154,6 +1154,10 @@ static int decode_pic(AVSContext *h) {
get_bits
(
&
s
->
gb
,
16
);
//bbv_dwlay
get_bits
(
&
s
->
gb
,
16
);
//bbv_dwlay
if
(
h
->
stc
==
PIC_PB_START_CODE
)
{
if
(
h
->
stc
==
PIC_PB_START_CODE
)
{
h
->
pic_type
=
get_bits
(
&
s
->
gb
,
2
)
+
FF_I_TYPE
;
h
->
pic_type
=
get_bits
(
&
s
->
gb
,
2
)
+
FF_I_TYPE
;
if
(
h
->
pic_type
>
FF_B_TYPE
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"illegal picture type
\n
"
);
return
-
1
;
}
/* make sure we have the reference frames we need */
/* make sure we have the reference frames we need */
if
(
!
h
->
DPB
[
0
].
data
[
0
]
||
if
(
!
h
->
DPB
[
0
].
data
[
0
]
||
(
!
h
->
DPB
[
1
].
data
[
0
]
&&
h
->
pic_type
==
FF_B_TYPE
))
(
!
h
->
DPB
[
1
].
data
[
0
]
&&
h
->
pic_type
==
FF_B_TYPE
))
...
...
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