Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
86e09b9e
Commit
86e09b9e
authored
Nov 14, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bfi: return meaningful error codes.
parent
fc2a94c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
bfi.c
libavcodec/bfi.c
+6
-6
No files found.
libavcodec/bfi.c
View file @
86e09b9e
...
@@ -55,16 +55,16 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -55,16 +55,16 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
uint8_t
*
src
,
*
dst_offset
,
colour1
,
colour2
;
uint8_t
*
src
,
*
dst_offset
,
colour1
,
colour2
;
uint8_t
*
frame_end
=
bfi
->
dst
+
avctx
->
width
*
avctx
->
height
;
uint8_t
*
frame_end
=
bfi
->
dst
+
avctx
->
width
*
avctx
->
height
;
uint32_t
*
pal
;
uint32_t
*
pal
;
int
i
,
j
,
height
=
avctx
->
height
;
int
i
,
j
,
ret
,
height
=
avctx
->
height
;
if
(
bfi
->
frame
.
data
[
0
])
if
(
bfi
->
frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
bfi
->
frame
);
avctx
->
release_buffer
(
avctx
,
&
bfi
->
frame
);
bfi
->
frame
.
reference
=
1
;
bfi
->
frame
.
reference
=
1
;
if
(
ff_get_buffer
(
avctx
,
&
bfi
->
frame
)
<
0
)
{
if
(
(
ret
=
ff_get_buffer
(
avctx
,
&
bfi
->
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
;
}
}
bytestream2_init
(
&
g
,
avpkt
->
data
,
buf_size
);
bytestream2_init
(
&
g
,
avpkt
->
data
,
buf_size
);
...
@@ -76,7 +76,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -76,7 +76,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
/* Setting the palette */
/* Setting the palette */
if
(
avctx
->
extradata_size
>
768
)
{
if
(
avctx
->
extradata_size
>
768
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Palette is too large.
\n
"
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"Palette is too large.
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
pal
=
(
uint32_t
*
)
bfi
->
frame
.
data
[
1
];
pal
=
(
uint32_t
*
)
bfi
->
frame
.
data
[
1
];
for
(
i
=
0
;
i
<
avctx
->
extradata_size
/
3
;
i
++
)
{
for
(
i
=
0
;
i
<
avctx
->
extradata_size
/
3
;
i
++
)
{
...
@@ -104,7 +104,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -104,7 +104,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
if
(
!
bytestream2_get_bytes_left
(
&
g
))
{
if
(
!
bytestream2_get_bytes_left
(
&
g
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Input resolution larger than actual frame.
\n
"
);
"Input resolution larger than actual frame.
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
/* Get length and offset (if required) */
/* Get length and offset (if required) */
...
@@ -130,7 +130,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -130,7 +130,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
case
0
:
// normal chain
case
0
:
// normal chain
if
(
length
>=
bytestream2_get_bytes_left
(
&
g
))
{
if
(
length
>=
bytestream2_get_bytes_left
(
&
g
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Frame larger than buffer.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Frame larger than buffer.
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
bytestream2_get_buffer
(
&
g
,
dst
,
length
);
bytestream2_get_buffer
(
&
g
,
dst
,
length
);
dst
+=
length
;
dst
+=
length
;
...
...
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