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
29330721
Commit
29330721
authored
Feb 13, 2012
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rv34: use AVERROR return values in ff_rv34_decode_frame()
Also adds an error message.
parent
bf61ef23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
rv34.c
libavcodec/rv34.c
+8
-4
No files found.
libavcodec/rv34.c
View file @
29330721
...
...
@@ -1652,15 +1652,19 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if
(
get_slice_offset
(
avctx
,
slices_hdr
,
0
)
<
0
||
get_slice_offset
(
avctx
,
slices_hdr
,
0
)
>
buf_size
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Slice offset is invalid
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
init_get_bits
(
&
s
->
gb
,
buf
+
get_slice_offset
(
avctx
,
slices_hdr
,
0
),
(
buf_size
-
get_slice_offset
(
avctx
,
slices_hdr
,
0
))
*
8
);
if
(
r
->
parse_slice_header
(
r
,
&
r
->
s
.
gb
,
&
si
)
<
0
||
si
.
start
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"First slice header is incorrect
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
((
!
s
->
last_picture_ptr
||
!
s
->
last_picture_ptr
->
f
.
data
[
0
])
&&
si
.
type
==
AV_PICTURE_TYPE_B
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid decoder state: B-frame without "
"reference data.
\n
"
);
return
AVERROR_INVALIDDATA
;
}
if
((
!
s
->
last_picture_ptr
||
!
s
->
last_picture_ptr
->
f
.
data
[
0
])
&&
si
.
type
==
AV_PICTURE_TYPE_B
)
return
-
1
;
if
(
(
avctx
->
skip_frame
>=
AVDISCARD_NONREF
&&
si
.
type
==
AV_PICTURE_TYPE_B
)
||
(
avctx
->
skip_frame
>=
AVDISCARD_NONKEY
&&
si
.
type
!=
AV_PICTURE_TYPE_I
)
||
avctx
->
skip_frame
>=
AVDISCARD_ALL
)
...
...
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