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
f3b74d94
Commit
f3b74d94
authored
Mar 04, 2015
by
Himangi Saraogi
Committed by
Diego Biurrun
Mar 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcxenc: Return more meaningful error codes
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
b72b212a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
pcxenc.c
libavcodec/pcxenc.c
+5
-5
No files found.
libavcodec/pcxenc.c
View file @
f3b74d94
...
@@ -68,7 +68,7 @@ static int pcx_rle_encode( uint8_t *dst, int dst_size,
...
@@ -68,7 +68,7 @@ static int pcx_rle_encode( uint8_t *dst, int dst_size,
// check worst-case upper bound on dst_size
// check worst-case upper bound on dst_size
if
(
dst_size
<
2LL
*
src_plane_size
*
nplanes
||
src_plane_size
<=
0
)
if
(
dst_size
<
2LL
*
src_plane_size
*
nplanes
||
src_plane_size
<=
0
)
return
-
1
;
return
AVERROR
(
EINVAL
)
;
for
(
p
=
0
;
p
<
nplanes
;
p
++
)
{
for
(
p
=
0
;
p
<
nplanes
;
p
++
)
{
int
count
=
1
;
int
count
=
1
;
...
@@ -112,7 +112,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -112,7 +112,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
(
avctx
->
width
>
65535
||
avctx
->
height
>
65535
)
{
if
(
avctx
->
width
>
65535
||
avctx
->
height
>
65535
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"image dimensions do not fit in 16 bits
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"image dimensions do not fit in 16 bits
\n
"
);
return
-
1
;
return
AVERROR
(
EINVAL
)
;
}
}
switch
(
avctx
->
pix_fmt
)
{
switch
(
avctx
->
pix_fmt
)
{
...
@@ -137,7 +137,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -137,7 +137,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
break
;
break
;
default:
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"unsupported pixfmt
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"unsupported pixfmt
\n
"
);
return
-
1
;
return
AVERROR
(
EINVAL
)
;
}
}
line_bytes
=
(
avctx
->
width
*
bpp
+
7
)
>>
3
;
line_bytes
=
(
avctx
->
width
*
bpp
+
7
)
>>
3
;
...
@@ -176,7 +176,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -176,7 +176,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
((
written
=
pcx_rle_encode
(
buf
,
buf_end
-
buf
,
if
((
written
=
pcx_rle_encode
(
buf
,
buf_end
-
buf
,
src
,
line_bytes
,
nplanes
))
<
0
)
{
src
,
line_bytes
,
nplanes
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"buffer too small
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"buffer too small
\n
"
);
return
-
1
;
return
AVERROR_BUG
;
}
}
buf
+=
written
;
buf
+=
written
;
src
+=
frame
->
linesize
[
0
];
src
+=
frame
->
linesize
[
0
];
...
@@ -185,7 +185,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -185,7 +185,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
(
nplanes
==
1
&&
bpp
==
8
)
{
if
(
nplanes
==
1
&&
bpp
==
8
)
{
if
(
buf_end
-
buf
<
257
)
{
if
(
buf_end
-
buf
<
257
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"buffer too small
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"buffer too small
\n
"
);
return
-
1
;
return
AVERROR_BUG
;
}
}
bytestream_put_byte
(
&
buf
,
12
);
bytestream_put_byte
(
&
buf
,
12
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
{
...
...
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