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
0baec57d
Commit
0baec57d
authored
Nov 11, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
anm: return meaningful error codes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
4d60e505
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
anm.c
libavcodec/anm.c
+6
-6
No files found.
libavcodec/anm.c
View file @
0baec57d
...
...
@@ -45,7 +45,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
s
->
frame
.
reference
=
3
;
bytestream2_init
(
&
s
->
gb
,
avctx
->
extradata
,
avctx
->
extradata_size
);
if
(
bytestream2_get_bytes_left
(
&
s
->
gb
)
<
16
*
8
+
4
*
256
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
bytestream2_skipu
(
&
s
->
gb
,
16
*
8
);
for
(
i
=
0
;
i
<
256
;
i
++
)
...
...
@@ -112,11 +112,11 @@ static int decode_frame(AVCodecContext *avctx,
AnmContext
*
s
=
avctx
->
priv_data
;
const
int
buf_size
=
avpkt
->
size
;
uint8_t
*
dst
,
*
dst_end
;
int
count
;
int
count
,
ret
;
if
(
avctx
->
reget_buffer
(
avctx
,
&
s
->
frame
)
<
0
)
{
if
((
ret
=
avctx
->
reget_buffer
(
avctx
,
&
s
->
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
dst
=
s
->
frame
.
data
[
0
];
dst_end
=
s
->
frame
.
data
[
0
]
+
s
->
frame
.
linesize
[
0
]
*
avctx
->
height
;
...
...
@@ -125,11 +125,11 @@ static int decode_frame(AVCodecContext *avctx,
if
(
bytestream2_get_byte
(
&
s
->
gb
)
!=
0x42
)
{
av_log_ask_for_sample
(
avctx
,
"unknown record type
\n
"
);
return
buf_size
;
return
AVERROR_INVALIDDATA
;
}
if
(
bytestream2_get_byte
(
&
s
->
gb
))
{
av_log_ask_for_sample
(
avctx
,
"padding bytes not supported
\n
"
);
return
buf_size
;
return
AVERROR_PATCHWELCOME
;
}
bytestream2_skip
(
&
s
->
gb
,
2
);
...
...
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