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
38de3365
Commit
38de3365
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
asvdec: return meaningful error codes.
parent
b3b17f78
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/asvdec.c
+10
-10
10 additions, 10 deletions
libavcodec/asvdec.c
with
10 additions
and
10 deletions
libavcodec/asvdec.c
+
10
−
10
View file @
38de3365
...
@@ -111,7 +111,7 @@ static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64])
...
@@ -111,7 +111,7 @@ static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64])
break
;
break
;
if
(
ccp
<
0
||
i
>=
10
)
{
if
(
ccp
<
0
||
i
>=
10
)
{
av_log
(
a
->
avctx
,
AV_LOG_ERROR
,
"coded coeff pattern damaged
\n
"
);
av_log
(
a
->
avctx
,
AV_LOG_ERROR
,
"coded coeff pattern damaged
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
ccp
&
8
)
if
(
ccp
&
8
)
...
@@ -213,15 +213,15 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -213,15 +213,15 @@ static int decode_frame(AVCodecContext *avctx,
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
AVFrame
*
picture
=
data
;
AVFrame
*
picture
=
data
;
AVFrame
*
const
p
=
&
a
->
picture
;
AVFrame
*
const
p
=
&
a
->
picture
;
int
mb_x
,
mb_y
;
int
mb_x
,
mb_y
,
ret
;
if
(
p
->
data
[
0
])
if
(
p
->
data
[
0
])
avctx
->
release_buffer
(
avctx
,
p
);
avctx
->
release_buffer
(
avctx
,
p
);
p
->
reference
=
0
;
p
->
reference
=
0
;
if
(
ff_get_buffer
(
avctx
,
p
)
<
0
)
{
if
(
(
ret
=
ff_get_buffer
(
avctx
,
p
)
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
}
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
key_frame
=
1
;
p
->
key_frame
=
1
;
...
@@ -243,8 +243,8 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -243,8 +243,8 @@ static int decode_frame(AVCodecContext *avctx,
for
(
mb_y
=
0
;
mb_y
<
a
->
mb_height2
;
mb_y
++
)
{
for
(
mb_y
=
0
;
mb_y
<
a
->
mb_height2
;
mb_y
++
)
{
for
(
mb_x
=
0
;
mb_x
<
a
->
mb_width2
;
mb_x
++
)
{
for
(
mb_x
=
0
;
mb_x
<
a
->
mb_width2
;
mb_x
++
)
{
if
(
decode_mb
(
a
,
a
->
block
)
<
0
)
if
(
(
ret
=
decode_mb
(
a
,
a
->
block
)
)
<
0
)
return
-
1
;
return
ret
;
idct_put
(
a
,
mb_x
,
mb_y
);
idct_put
(
a
,
mb_x
,
mb_y
);
}
}
...
@@ -253,8 +253,8 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -253,8 +253,8 @@ static int decode_frame(AVCodecContext *avctx,
if
(
a
->
mb_width2
!=
a
->
mb_width
)
{
if
(
a
->
mb_width2
!=
a
->
mb_width
)
{
mb_x
=
a
->
mb_width2
;
mb_x
=
a
->
mb_width2
;
for
(
mb_y
=
0
;
mb_y
<
a
->
mb_height2
;
mb_y
++
)
{
for
(
mb_y
=
0
;
mb_y
<
a
->
mb_height2
;
mb_y
++
)
{
if
(
decode_mb
(
a
,
a
->
block
)
<
0
)
if
(
(
ret
=
decode_mb
(
a
,
a
->
block
)
)
<
0
)
return
-
1
;
return
ret
;
idct_put
(
a
,
mb_x
,
mb_y
);
idct_put
(
a
,
mb_x
,
mb_y
);
}
}
...
@@ -263,8 +263,8 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -263,8 +263,8 @@ static int decode_frame(AVCodecContext *avctx,
if
(
a
->
mb_height2
!=
a
->
mb_height
)
{
if
(
a
->
mb_height2
!=
a
->
mb_height
)
{
mb_y
=
a
->
mb_height2
;
mb_y
=
a
->
mb_height2
;
for
(
mb_x
=
0
;
mb_x
<
a
->
mb_width
;
mb_x
++
)
{
for
(
mb_x
=
0
;
mb_x
<
a
->
mb_width
;
mb_x
++
)
{
if
(
decode_mb
(
a
,
a
->
block
)
<
0
)
if
(
(
ret
=
decode_mb
(
a
,
a
->
block
)
)
<
0
)
return
-
1
;
return
ret
;
idct_put
(
a
,
mb_x
,
mb_y
);
idct_put
(
a
,
mb_x
,
mb_y
);
}
}
...
...
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