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
445f36d7
Commit
445f36d7
authored
Oct 17, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kmvc: use meaningful error codes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
be536f08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
kmvc.c
libavcodec/kmvc.c
+6
-5
No files found.
libavcodec/kmvc.c
View file @
445f36d7
...
...
@@ -266,6 +266,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
int
header
;
int
blocksize
;
const
uint8_t
*
pal
=
av_packet_get_side_data
(
avpkt
,
AV_PKT_DATA_PALETTE
,
NULL
);
int
ret
;
bytestream2_init
(
&
ctx
->
g
,
avpkt
->
data
,
avpkt
->
size
);
if
(
ctx
->
pic
.
data
[
0
])
...
...
@@ -273,9 +274,9 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
ctx
->
pic
.
reference
=
3
;
ctx
->
pic
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
;
if
(
avctx
->
get_buffer
(
avctx
,
&
ctx
->
pic
)
<
0
)
{
if
(
(
ret
=
avctx
->
get_buffer
(
avctx
,
&
ctx
->
pic
)
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
header
=
bytestream2_get_byte
(
&
ctx
->
g
);
...
...
@@ -323,7 +324,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
if
(
blocksize
!=
8
&&
blocksize
!=
127
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Block size = %i
\n
"
,
blocksize
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
memset
(
ctx
->
cur
,
0
,
320
*
200
);
switch
(
header
&
KMVC_METHOD
)
{
...
...
@@ -339,7 +340,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown compression method %i
\n
"
,
header
&
KMVC_METHOD
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
out
=
ctx
->
pic
.
data
[
0
];
...
...
@@ -380,7 +381,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
if
(
avctx
->
width
>
320
||
avctx
->
height
>
200
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"KMVC supports frames <= 320x200
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
c
->
frm0
=
av_mallocz
(
320
*
200
);
...
...
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