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
e3edee6d
Commit
e3edee6d
authored
Nov 17, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eamad: return meaningful error codes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
d98364ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
eamad.c
libavcodec/eamad.c
+8
-8
No files found.
libavcodec/eamad.c
View file @
e3edee6d
...
@@ -233,14 +233,14 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -233,14 +233,14 @@ static int decode_frame(AVCodecContext *avctx,
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
const
uint8_t
*
buf_end
=
buf
+
buf_size
;
const
uint8_t
*
buf_end
=
buf
+
buf_size
;
MadContext
*
s
=
avctx
->
priv_data
;
MadContext
*
s
=
avctx
->
priv_data
;
int
width
,
height
;
int
width
,
height
,
ret
;
int
chunk_type
;
int
chunk_type
;
int
inter
;
int
inter
;
if
(
buf_size
<
26
)
{
if
(
buf_size
<
26
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Input buffer too small
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Input buffer too small
\n
"
);
*
data_size
=
0
;
*
data_size
=
0
;
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
chunk_type
=
AV_RL32
(
&
buf
[
0
]);
chunk_type
=
AV_RL32
(
&
buf
[
0
]);
...
@@ -257,9 +257,9 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -257,9 +257,9 @@ static int decode_frame(AVCodecContext *avctx,
if
(
avctx
->
width
!=
width
||
avctx
->
height
!=
height
)
{
if
(
avctx
->
width
!=
width
||
avctx
->
height
!=
height
)
{
if
((
width
*
height
)
/
2048
*
7
>
buf_end
-
buf
)
if
((
width
*
height
)
/
2048
*
7
>
buf_end
-
buf
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
if
(
av_image_check_size
(
width
,
height
,
0
,
avctx
)
<
0
)
if
(
(
ret
=
av_image_check_size
(
width
,
height
,
0
,
avctx
)
)
<
0
)
return
-
1
;
return
ret
;
avcodec_set_dimensions
(
avctx
,
width
,
height
);
avcodec_set_dimensions
(
avctx
,
width
,
height
);
if
(
s
->
frame
.
data
[
0
])
if
(
s
->
frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
...
@@ -269,9 +269,9 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -269,9 +269,9 @@ static int decode_frame(AVCodecContext *avctx,
s
->
frame
.
reference
=
3
;
s
->
frame
.
reference
=
3
;
if
(
!
s
->
frame
.
data
[
0
])
{
if
(
!
s
->
frame
.
data
[
0
])
{
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
<
0
)
{
if
(
(
ret
=
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
)
<
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
;
}
}
}
}
...
@@ -285,7 +285,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -285,7 +285,7 @@ static int decode_frame(AVCodecContext *avctx,
for
(
s
->
mb_y
=
0
;
s
->
mb_y
<
(
avctx
->
height
+
15
)
/
16
;
s
->
mb_y
++
)
for
(
s
->
mb_y
=
0
;
s
->
mb_y
<
(
avctx
->
height
+
15
)
/
16
;
s
->
mb_y
++
)
for
(
s
->
mb_x
=
0
;
s
->
mb_x
<
(
avctx
->
width
+
15
)
/
16
;
s
->
mb_x
++
)
for
(
s
->
mb_x
=
0
;
s
->
mb_x
<
(
avctx
->
width
+
15
)
/
16
;
s
->
mb_x
++
)
if
(
decode_mb
(
s
,
inter
)
<
0
)
if
(
decode_mb
(
s
,
inter
)
<
0
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
*
data_size
=
sizeof
(
AVFrame
);
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
s
->
frame
;
*
(
AVFrame
*
)
data
=
s
->
frame
;
...
...
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