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
0aabd35b
Commit
0aabd35b
authored
Dec 05, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/dxa: return meaningful error codes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
c5008135
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
dxa.c
libavformat/dxa.c
+6
-6
No files found.
libavformat/dxa.c
View file @
0aabd35b
...
...
@@ -65,12 +65,12 @@ static int dxa_read_header(AVFormatContext *s)
tag
=
avio_rl32
(
pb
);
if
(
tag
!=
MKTAG
(
'D'
,
'E'
,
'X'
,
'A'
))
return
-
1
;
return
AVERROR_INVALIDDATA
;
flags
=
avio_r8
(
pb
);
c
->
frames
=
avio_rb16
(
pb
);
if
(
!
c
->
frames
){
av_log
(
s
,
AV_LOG_ERROR
,
"File contains no frames ???
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
fps
=
avio_rb32
(
pb
);
...
...
@@ -90,7 +90,7 @@ static int dxa_read_header(AVFormatContext *s)
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
// Parse WAV data header
if
(
avio_rl32
(
pb
)
==
MKTAG
(
'W'
,
'A'
,
'V'
,
'E'
)){
...
...
@@ -103,7 +103,7 @@ static int dxa_read_header(AVFormatContext *s)
ast
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
ast
)
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
ret
=
ff_get_wav_header
(
pb
,
ast
->
codec
,
fsize
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -191,7 +191,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
size
=
AV_RB32
(
buf
+
5
);
if
(
size
>
0xFFFFFF
){
av_log
(
s
,
AV_LOG_ERROR
,
"Frame size is too big: %d
\n
"
,
size
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
av_new_packet
(
pkt
,
size
+
DXA_EXTRA_SIZE
+
pal_size
)
<
0
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -209,7 +209,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
return
0
;
default:
av_log
(
s
,
AV_LOG_ERROR
,
"Unknown tag %c%c%c%c
\n
"
,
buf
[
0
],
buf
[
1
],
buf
[
2
],
buf
[
3
]);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
return
AVERROR_EOF
;
...
...
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