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
7510a9a4
Commit
7510a9a4
authored
Dec 06, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/apedec: return meaningful error codes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
4d1912ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ape.c
libavformat/ape.c
+5
-5
No files found.
libavformat/ape.c
View file @
7510a9a4
...
...
@@ -165,14 +165,14 @@ static int ape_read_header(AVFormatContext * s)
tag
=
avio_rl32
(
pb
);
if
(
tag
!=
MKTAG
(
'M'
,
'A'
,
'C'
,
' '
))
return
-
1
;
return
AVERROR_INVALIDDATA
;
ape
->
fileversion
=
avio_rl16
(
pb
);
if
(
ape
->
fileversion
<
APE_MIN_VERSION
||
ape
->
fileversion
>
APE_MAX_VERSION
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unsupported file version - %d.%02d
\n
"
,
ape
->
fileversion
/
1000
,
(
ape
->
fileversion
%
1000
)
/
10
);
return
-
1
;
return
AVERROR_PATCHWELCOME
;
}
if
(
ape
->
fileversion
>=
3980
)
{
...
...
@@ -251,7 +251,7 @@ static int ape_read_header(AVFormatContext * s)
if
(
ape
->
totalframes
>
UINT_MAX
/
sizeof
(
APEFrame
)){
av_log
(
s
,
AV_LOG_ERROR
,
"Too many frames: %"
PRIu32
"
\n
"
,
ape
->
totalframes
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
ape
->
seektablelength
&&
(
ape
->
seektablelength
/
sizeof
(
*
ape
->
seektable
))
<
ape
->
totalframes
)
{
av_log
(
s
,
AV_LOG_ERROR
,
...
...
@@ -278,7 +278,7 @@ static int ape_read_header(AVFormatContext * s)
ape
->
seektable
[
i
]
=
avio_rl32
(
pb
);
}
else
{
av_log
(
s
,
AV_LOG_ERROR
,
"Missing seektable
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
ape
->
frames
[
0
].
pos
=
ape
->
firstframe
;
...
...
@@ -320,7 +320,7 @@ static int ape_read_header(AVFormatContext * s)
/* now we are ready: build format streams */
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
total_blocks
=
(
ape
->
totalframes
==
0
)
?
0
:
((
ape
->
totalframes
-
1
)
*
ape
->
blocksperframe
)
+
ape
->
finalframeblocks
;
...
...
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