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
6ed38b1f
Commit
6ed38b1f
authored
Mar 29, 2015
by
Himangi Saraogi
Committed by
Diego Biurrun
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiff: Return more meaningful error codes
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
23944d29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
tiffenc.c
libavcodec/tiffenc.c
+6
-5
No files found.
libavcodec/tiffenc.c
View file @
6ed38b1f
...
...
@@ -153,7 +153,8 @@ static int add_entry1(TiffEncoderContext *s,
* @param dst Output buffer
* @param n Size of input buffer
* @param compr Compression method
* @return Number of output bytes. If an output error is encountered, -1 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
,
uint8_t
*
dst
,
int
n
,
int
compr
)
...
...
@@ -166,14 +167,14 @@ static int encode_strip(TiffEncoderContext *s, const int8_t *src,
unsigned
long
zlen
=
s
->
buf_size
-
(
*
s
->
buf
-
s
->
buf_start
);
if
(
compress
(
dst
,
&
zlen
,
src
,
n
)
!=
Z_OK
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Compressing failed
\n
"
);
return
-
1
;
return
AVERROR_UNKNOWN
;
}
return
zlen
;
}
#endif
case
TIFF_RAW
:
if
(
check_size
(
s
,
n
))
return
-
1
;
return
AVERROR
(
EINVAL
)
;
memcpy
(
dst
,
src
,
n
);
return
n
;
case
TIFF_PACKBITS
:
...
...
@@ -182,7 +183,7 @@ static int encode_strip(TiffEncoderContext *s, const int8_t *src,
case
TIFF_LZW
:
return
ff_lzw_encode
(
s
->
lzws
,
src
,
n
);
default:
return
-
1
;
return
AVERROR
(
EINVAL
)
;
}
}
...
...
@@ -291,7 +292,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
default:
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"This colors format is not supported
\n
"
);
return
-
1
;
return
AVERROR
(
EINVAL
)
;
}
if
(
s
->
compr
==
TIFF_DEFLATE
||
...
...
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