---
libavcodec/tiffenc.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 169360f..719b0ce 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -164,16 +164,17 @@ static int encode_strip(TiffEncoderContext *s, const
int8_t *src,
case TIFF_ADOBE_DEFLATE:
{
unsigned long zlen = s->buf_size - (*s->buf - s->buf_start);
- if (compress(dst, &zlen, src, n) != Z_OK) {
+ int ret = compress(dst, &zlen, src, n);
+ if (ret != Z_OK) {
av_log(s->avctx, AV_LOG_ERROR, "Compressing failed\n");
- return -1;
+ return ret;
}
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_UNKNOWN;
}
}
@@ -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_INVALIDDATA;
}
if (s->compr == TIFF_DEFLATE ||
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel