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
0187c2cc
Commit
0187c2cc
authored
Mar 30, 2015
by
Himangi Saraogi
Committed by
Michael Niedermayer
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiff: Return more meaningful error codes
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ac9919b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
tiffenc.c
libavcodec/tiffenc.c
+8
-5
No files found.
libavcodec/tiffenc.c
View file @
0187c2cc
...
@@ -164,7 +164,8 @@ static int add_entry1(TiffEncoderContext *s,
...
@@ -164,7 +164,8 @@ static int add_entry1(TiffEncoderContext *s,
* @param dst output buffer
* @param dst output buffer
* @param n size of input buffer
* @param n size of input buffer
* @param compr compression method
* @param compr compression method
* @return number of output bytes. If an output error is encountered, -1 is returned
* @return number of output bytes. If an output error is encountered, a negative
* value corresponding to an AVERROR error code is returned.
*/
*/
static
int
encode_strip
(
TiffEncoderContext
*
s
,
const
int8_t
*
src
,
static
int
encode_strip
(
TiffEncoderContext
*
s
,
const
int8_t
*
src
,
uint8_t
*
dst
,
int
n
,
int
compr
)
uint8_t
*
dst
,
int
n
,
int
compr
)
...
@@ -177,14 +178,14 @@ static int encode_strip(TiffEncoderContext *s, const int8_t *src,
...
@@ -177,14 +178,14 @@ static int encode_strip(TiffEncoderContext *s, const int8_t *src,
unsigned
long
zlen
=
s
->
buf_size
-
(
*
s
->
buf
-
s
->
buf_start
);
unsigned
long
zlen
=
s
->
buf_size
-
(
*
s
->
buf
-
s
->
buf_start
);
if
(
compress
(
dst
,
&
zlen
,
src
,
n
)
!=
Z_OK
)
{
if
(
compress
(
dst
,
&
zlen
,
src
,
n
)
!=
Z_OK
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Compressing failed
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Compressing failed
\n
"
);
return
-
1
;
return
AVERROR_EXTERNAL
;
}
}
return
zlen
;
return
zlen
;
}
}
#endif
#endif
case
TIFF_RAW
:
case
TIFF_RAW
:
if
(
check_size
(
s
,
n
))
if
(
check_size
(
s
,
n
))
return
-
1
;
return
AVERROR
(
EINVAL
)
;
memcpy
(
dst
,
src
,
n
);
memcpy
(
dst
,
src
,
n
);
return
n
;
return
n
;
case
TIFF_PACKBITS
:
case
TIFF_PACKBITS
:
...
@@ -193,7 +194,9 @@ static int encode_strip(TiffEncoderContext *s, const int8_t *src,
...
@@ -193,7 +194,9 @@ static int encode_strip(TiffEncoderContext *s, const int8_t *src,
case
TIFF_LZW
:
case
TIFF_LZW
:
return
ff_lzw_encode
(
s
->
lzws
,
src
,
n
);
return
ff_lzw_encode
(
s
->
lzws
,
src
,
n
);
default:
default:
return
-
1
;
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Unsupported compression method: %d
\n
"
,
compr
);
return
AVERROR
(
EINVAL
);
}
}
}
}
...
@@ -304,7 +307,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -304,7 +307,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
default:
default:
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"This colors format is not supported
\n
"
);
"This colors format is not supported
\n
"
);
return
-
1
;
return
AVERROR
(
EINVAL
)
;
}
}
for
(
i
=
0
;
i
<
s
->
bpp_tab_size
;
i
++
)
for
(
i
=
0
;
i
<
s
->
bpp_tab_size
;
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