diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index c061ac985f..8cda2b2d36 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -463,7 +463,7 @@ fail: av_free(strip_sizes); av_free(strip_offsets); av_free(yuv_line); - return ret; + return ret < 0 ? ret : 0; } #define OFFSET(x) offsetof(TiffEncoderContext, x)