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
10411afd
Commit
10411afd
authored
Nov 15, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpeg4videodec: replace some return -1 by more specific error codes
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
18fcdc09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
mpeg4videodec.c
libavcodec/mpeg4videodec.c
+6
-6
No files found.
libavcodec/mpeg4videodec.c
View file @
10411afd
...
...
@@ -1763,7 +1763,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
s
->
avctx
->
framerate
.
num
=
get_bits
(
gb
,
16
);
if
(
!
s
->
avctx
->
framerate
.
num
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"framerate==0
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
ctx
->
time_increment_bits
=
av_log2
(
s
->
avctx
->
framerate
.
num
-
1
)
+
1
;
...
...
@@ -1829,7 +1829,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
"%d sprite_warping_points
\n
"
,
ctx
->
num_sprite_warping_points
);
ctx
->
num_sprite_warping_points
=
0
;
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
s
->
sprite_warping_accuracy
=
get_bits
(
gb
,
2
);
ctx
->
sprite_brightness_change
=
get_bits1
(
gb
);
...
...
@@ -2374,7 +2374,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
if
(
get_bits_left
(
gb
)
<
3
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Header truncated
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
ctx
->
intra_dc_threshold
=
ff_mpeg4_dc_threshold
[
get_bits
(
gb
,
3
)];
if
(
!
s
->
progressive_sequence
)
{
...
...
@@ -2413,7 +2413,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
if
(
s
->
qscale
==
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Error, header damaged or not MPEG4 header (qscale=0)
\n
"
);
return
-
1
;
// makes no sense to continue, as there is nothing left from the image then
return
AVERROR_INVALIDDATA
;
// makes no sense to continue, as there is nothing left from the image then
}
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
)
{
...
...
@@ -2422,7 +2422,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Error, header damaged or not MPEG4 header (f_code=0)
\n
"
);
s
->
f_code
=
1
;
return
-
1
;
// makes no sense to continue, as there is nothing left from the image then
return
AVERROR_INVALIDDATA
;
// makes no sense to continue, as there is nothing left from the image then
}
}
else
s
->
f_code
=
1
;
...
...
@@ -2433,7 +2433,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Error, header damaged or not MPEG4 header (b_code=0)
\n
"
);
s
->
b_code
=
1
;
return
-
1
;
// makes no sense to continue, as the MV decoding will break very quickly
return
AVERROR_INVALIDDATA
;
// makes no sense to continue, as the MV decoding will break very quickly
}
}
else
s
->
b_code
=
1
;
...
...
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