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
f3e04526
Commit
f3e04526
authored
Feb 15, 2015
by
Himangi Saraogi
Committed by
Vittorio Giovara
Feb 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qdm2: Return meaningful error codes
parent
a1e2c47c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
qdm2.c
libavcodec/qdm2.c
+11
-11
No files found.
libavcodec/qdm2.c
View file @
f3e04526
...
...
@@ -1762,7 +1762,7 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
if
(
!
avctx
->
extradata
||
(
avctx
->
extradata_size
<
48
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"extradata missing or truncated
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
extradata
=
avctx
->
extradata
;
...
...
@@ -1778,18 +1778,18 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
if
(
extradata_size
<
12
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"not enough extradata (%i)
\n
"
,
extradata_size
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
memcmp
(
extradata
,
"frmaQDM"
,
7
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid headers, QDM? not found
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
extradata
[
7
]
==
'C'
)
{
// s->is_qdmc = 1;
av
_log
(
avctx
,
AV_LOG_ERROR
,
"stream is QDMC version 1, which is not supported
\n
"
);
return
-
1
;
av
priv_report_missing_feature
(
avctx
,
"QDMC version 1
"
);
return
AVERROR_PATCHWELCOME
;
}
extradata
+=
8
;
...
...
@@ -1800,14 +1800,14 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
if
(
size
>
extradata_size
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"extradata size too small, %i < %i
\n
"
,
extradata_size
,
size
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
extradata
+=
4
;
av_log
(
avctx
,
AV_LOG_DEBUG
,
"size: %d
\n
"
,
size
);
if
(
AV_RB32
(
extradata
)
!=
MKBETAG
(
'Q'
,
'D'
,
'C'
,
'A'
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid extradata, expecting QDCA
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
extradata
+=
8
;
...
...
@@ -1882,8 +1882,8 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
// Fail on unknown fft order
if
((
s
->
fft_order
<
7
)
||
(
s
->
fft_order
>
9
))
{
av
_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown FFT order (%d), contact the developers!
\n
"
,
s
->
fft_order
);
return
-
1
;
av
priv_request_sample
(
avctx
,
"Unknown FFT order %d
"
,
s
->
fft_order
);
return
AVERROR_PATCHWELCOME
;
}
if
(
s
->
fft_size
!=
(
1
<<
(
s
->
fft_order
-
1
)))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"FFT size %d not power of 2.
\n
"
,
s
->
fft_size
);
...
...
@@ -1990,8 +1990,8 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data,
out
=
(
int16_t
*
)
frame
->
data
[
0
];
for
(
i
=
0
;
i
<
16
;
i
++
)
{
if
(
qdm2_decode
(
s
,
buf
,
out
)
<
0
)
return
-
1
;
if
(
(
ret
=
qdm2_decode
(
s
,
buf
,
out
)
)
<
0
)
return
ret
;
out
+=
s
->
channels
*
s
->
frame_size
;
}
...
...
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