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
5f614bcf
Commit
5f614bcf
authored
Oct 30, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vqavideo: return more meaningful error codes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
4b7f34a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
vqavideo.c
libavcodec/vqavideo.c
+6
-6
No files found.
libavcodec/vqavideo.c
View file @
5f614bcf
...
@@ -129,20 +129,20 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
...
@@ -129,20 +129,20 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
/* make sure the extradata made it */
/* make sure the extradata made it */
if
(
s
->
avctx
->
extradata_size
!=
VQA_HEADER_SIZE
)
{
if
(
s
->
avctx
->
extradata_size
!=
VQA_HEADER_SIZE
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"expected extradata size of %d
\n
"
,
VQA_HEADER_SIZE
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"expected extradata size of %d
\n
"
,
VQA_HEADER_SIZE
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
/* load up the VQA parameters from the header */
/* load up the VQA parameters from the header */
s
->
vqa_version
=
s
->
avctx
->
extradata
[
0
];
s
->
vqa_version
=
s
->
avctx
->
extradata
[
0
];
if
(
s
->
vqa_version
<
1
||
s
->
vqa_version
>
3
)
{
if
(
s
->
vqa_version
<
1
||
s
->
vqa_version
>
3
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"unsupported version %d
\n
"
,
s
->
vqa_version
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"unsupported version %d
\n
"
,
s
->
vqa_version
);
return
-
1
;
return
AVERROR_PATCHWELCOME
;
}
}
s
->
width
=
AV_RL16
(
&
s
->
avctx
->
extradata
[
6
]);
s
->
width
=
AV_RL16
(
&
s
->
avctx
->
extradata
[
6
]);
s
->
height
=
AV_RL16
(
&
s
->
avctx
->
extradata
[
8
]);
s
->
height
=
AV_RL16
(
&
s
->
avctx
->
extradata
[
8
]);
if
(
av_image_check_size
(
s
->
width
,
s
->
height
,
0
,
avctx
)){
if
(
av_image_check_size
(
s
->
width
,
s
->
height
,
0
,
avctx
)){
s
->
width
=
s
->
height
=
0
;
s
->
width
=
s
->
height
=
0
;
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
s
->
vector_width
=
s
->
avctx
->
extradata
[
10
];
s
->
vector_width
=
s
->
avctx
->
extradata
[
10
];
s
->
vector_height
=
s
->
avctx
->
extradata
[
11
];
s
->
vector_height
=
s
->
avctx
->
extradata
[
11
];
...
@@ -152,7 +152,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
...
@@ -152,7 +152,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
if
((
s
->
vector_width
!=
4
)
||
if
((
s
->
vector_width
!=
4
)
||
((
s
->
vector_height
!=
2
)
&&
(
s
->
vector_height
!=
4
)))
{
((
s
->
vector_height
!=
2
)
&&
(
s
->
vector_height
!=
4
)))
{
/* return without further initialization */
/* return without further initialization */
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
s
->
width
%
s
->
vector_width
||
s
->
height
%
s
->
vector_height
)
{
if
(
s
->
width
%
s
->
vector_width
||
s
->
height
%
s
->
vector_height
)
{
...
@@ -593,9 +593,9 @@ static int vqa_decode_frame(AVCodecContext *avctx,
...
@@ -593,9 +593,9 @@ static int vqa_decode_frame(AVCodecContext *avctx,
if
(
s
->
frame
.
data
[
0
])
if
(
s
->
frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
))
{
if
(
(
res
=
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
))
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
res
;
}
}
bytestream2_init
(
&
s
->
gb
,
avpkt
->
data
,
avpkt
->
size
);
bytestream2_init
(
&
s
->
gb
,
avpkt
->
data
,
avpkt
->
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