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
1b20d0f5
Commit
1b20d0f5
authored
Oct 13, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cavs: Return meaningful error values
parent
14ddbb47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
cavsdec.c
libavcodec/cavsdec.c
+10
-10
No files found.
libavcodec/cavsdec.c
View file @
1b20d0f5
...
...
@@ -530,7 +530,7 @@ static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf,
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"position out of block bounds at pic %d MB(%d,%d)
\n
"
,
h
->
cur
.
poc
,
h
->
mbx
,
h
->
mby
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
dst
[
scantab
[
pos
]]
=
(
level_buf
[
coeff_num
]
*
mul
+
round
)
>>
shift
;
}
...
...
@@ -550,7 +550,7 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
const
struct
dec_2dvlc
*
r
,
int
esc_golomb_order
,
int
qp
,
uint8_t
*
dst
,
int
stride
)
{
int
i
,
level_code
,
esc_code
,
level
,
run
,
mask
;
int
i
,
level_code
,
esc_code
,
level
,
run
,
mask
,
ret
;
int16_t
level_buf
[
65
];
uint8_t
run_buf
[
65
];
int16_t
*
block
=
h
->
block
;
...
...
@@ -577,9 +577,9 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
level_buf
[
i
]
=
level
;
run_buf
[
i
]
=
run
;
}
if
(
dequant
(
h
,
level_buf
,
run_buf
,
block
,
dequant_mul
[
qp
],
dequant_shift
[
qp
],
i
)
)
return
-
1
;
if
(
(
ret
=
dequant
(
h
,
level_buf
,
run_buf
,
block
,
dequant_mul
[
qp
],
dequant_shift
[
qp
],
i
))
<
0
)
return
ret
;
h
->
cdsp
.
cavs_idct8_add
(
dst
,
block
,
stride
);
h
->
dsp
.
clear_block
(
block
);
return
0
;
...
...
@@ -604,7 +604,7 @@ static inline int decode_residual_inter(AVSContext *h)
int
cbp
=
get_ue_golomb
(
&
h
->
gb
);
if
(
cbp
>
63
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal inter cbp
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
h
->
cbp
=
cbp_tab
[
cbp
][
1
];
...
...
@@ -666,7 +666,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code)
pred_mode_uv
=
get_ue_golomb
(
gb
);
if
(
pred_mode_uv
>
6
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal intra chroma pred mode
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
ff_cavs_modify_mb_i
(
h
,
&
pred_mode_uv
);
...
...
@@ -675,7 +675,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code)
cbp_code
=
get_ue_golomb
(
gb
);
if
(
cbp_code
>
63
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal intra cbp
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
h
->
cbp
=
cbp_tab
[
cbp_code
][
0
];
if
(
h
->
cbp
&&
!
h
->
qp_fixed
)
...
...
@@ -943,12 +943,12 @@ static int decode_pic(AVSContext *h)
h
->
cur
.
f
->
pict_type
=
get_bits
(
&
h
->
gb
,
2
)
+
AV_PICTURE_TYPE_I
;
if
(
h
->
cur
.
f
->
pict_type
>
AV_PICTURE_TYPE_B
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal picture type
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
/* make sure we have the reference frames we need */
if
(
!
h
->
DPB
[
0
].
f
->
data
[
0
]
||
(
!
h
->
DPB
[
1
].
f
->
data
[
0
]
&&
h
->
cur
.
f
->
pict_type
==
AV_PICTURE_TYPE_B
))
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
else
{
h
->
cur
.
f
->
pict_type
=
AV_PICTURE_TYPE_I
;
if
(
get_bits1
(
&
h
->
gb
))
...
...
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