Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
6ea2c9a4
Commit
6ea2c9a4
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
indeo2: return meaningful error codes
parent
6781b531
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/indeo2.c
+7
-7
7 additions, 7 deletions
libavcodec/indeo2.c
with
7 additions
and
7 deletions
libavcodec/indeo2.c
+
7
−
7
View file @
6ea2c9a4
...
@@ -57,7 +57,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
...
@@ -57,7 +57,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
int
t
;
int
t
;
if
(
width
&
1
)
if
(
width
&
1
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
/* first line contain absolute values, other lines contain deltas */
/* first line contain absolute values, other lines contain deltas */
while
(
out
<
width
){
while
(
out
<
width
){
...
@@ -65,7 +65,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
...
@@ -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 */
if
(
c
>=
0x80
)
{
/* we have a run */
c
-=
0x7F
;
c
-=
0x7F
;
if
(
out
+
c
*
2
>
width
)
if
(
out
+
c
*
2
>
width
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
dst
[
out
++
]
=
0x80
;
dst
[
out
++
]
=
0x80
;
}
else
{
/* copy two values from table */
}
else
{
/* copy two values from table */
...
@@ -82,7 +82,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
...
@@ -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 */
if
(
c
>=
0x80
)
{
/* we have a skip */
c
-=
0x7F
;
c
-=
0x7F
;
if
(
out
+
c
*
2
>
width
)
if
(
out
+
c
*
2
>
width
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
{
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
{
dst
[
out
]
=
dst
[
out
-
stride
];
dst
[
out
]
=
dst
[
out
-
stride
];
out
++
;
out
++
;
...
@@ -112,7 +112,7 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
...
@@ -112,7 +112,7 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
int
t
;
int
t
;
if
(
width
&
1
)
if
(
width
&
1
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
j
=
0
;
j
<
height
;
j
++
){
for
(
j
=
0
;
j
<
height
;
j
++
){
out
=
0
;
out
=
0
;
...
@@ -146,16 +146,16 @@ static int ir2_decode_frame(AVCodecContext *avctx,
...
@@ -146,16 +146,16 @@ static int ir2_decode_frame(AVCodecContext *avctx,
Ir2Context
*
const
s
=
avctx
->
priv_data
;
Ir2Context
*
const
s
=
avctx
->
priv_data
;
AVFrame
*
picture
=
data
;
AVFrame
*
picture
=
data
;
AVFrame
*
const
p
=
&
s
->
picture
;
AVFrame
*
const
p
=
&
s
->
picture
;
int
start
;
int
start
,
ret
;
if
(
p
->
data
[
0
])
if
(
p
->
data
[
0
])
avctx
->
release_buffer
(
avctx
,
p
);
avctx
->
release_buffer
(
avctx
,
p
);
p
->
reference
=
1
;
p
->
reference
=
1
;
p
->
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_PRESERVE
|
FF_BUFFER_HINTS_REUSABLE
;
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
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"reget_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
}
start
=
48
;
/* hardcoded for now */
start
=
48
;
/* hardcoded for now */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment