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
6ea2c9a4
Commit
6ea2c9a4
authored
Nov 17, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indeo2: return meaningful error codes
parent
6781b531
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
indeo2.c
libavcodec/indeo2.c
+7
-7
No files found.
libavcodec/indeo2.c
View file @
6ea2c9a4
...
...
@@ -57,7 +57,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
int
t
;
if
(
width
&
1
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
/* first line contain absolute values, other lines contain deltas */
while
(
out
<
width
){
...
...
@@ -65,7 +65,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
if
(
c
>=
0x80
)
{
/* we have a run */
c
-=
0x7F
;
if
(
out
+
c
*
2
>
width
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
dst
[
out
++
]
=
0x80
;
}
else
{
/* copy two values from table */
...
...
@@ -82,7 +82,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
if
(
c
>=
0x80
)
{
/* we have a skip */
c
-=
0x7F
;
if
(
out
+
c
*
2
>
width
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
{
dst
[
out
]
=
dst
[
out
-
stride
];
out
++
;
...
...
@@ -112,7 +112,7 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
int
t
;
if
(
width
&
1
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
j
=
0
;
j
<
height
;
j
++
){
out
=
0
;
...
...
@@ -146,16 +146,16 @@ static int ir2_decode_frame(AVCodecContext *avctx,
Ir2Context
*
const
s
=
avctx
->
priv_data
;
AVFrame
*
picture
=
data
;
AVFrame
*
const
p
=
&
s
->
picture
;
int
start
;
int
start
,
ret
;
if
(
p
->
data
[
0
])
avctx
->
release_buffer
(
avctx
,
p
);
p
->
reference
=
1
;
p
->
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_PRESERVE
|
FF_BUFFER_HINTS_REUSABLE
;
if
(
avctx
->
reget_buffer
(
avctx
,
p
)
)
{
if
(
(
ret
=
avctx
->
reget_buffer
(
avctx
,
p
))
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"reget_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
start
=
48
;
/* hardcoded for now */
...
...
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