diff options
author | Diego Biurrun <diego@biurrun.de> | 2015-12-08 10:22:15 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-11-11 10:17:07 +0100 |
commit | f7d183f08472e566a2e6b62a80e200a12670ed0e (patch) | |
tree | b9b16c792c27c23b56a431677dbf31d079ed36c0 /libavcodec | |
parent | e5e8a26dcf6d572e841a7a191e4c96524367e3f9 (diff) | |
download | ffmpeg-f7d183f08472e566a2e6b62a80e200a12670ed0e.tar.gz |
libxvid: Check return value of write() call
libavcodec/libxvid_rc.c:106:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libxvid_rc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/libxvid_rc.c b/libavcodec/libxvid_rc.c index eddbbe8c65..94301a2ac1 100644 --- a/libavcodec/libxvid_rc.c +++ b/libavcodec/libxvid_rc.c @@ -87,7 +87,10 @@ av_cold int ff_xvid_rate_control_init(MpegEncContext *s) (rce->i_tex_bits + rce->p_tex_bits + rce->misc_bits + 7) / 8, (rce->header_bits + rce->mv_bits + 7) / 8); - write(fd, tmp, strlen(tmp)); + if (strlen(tmp) > write(fd, tmp, strlen(tmp))) { + av_log(s, AV_LOG_ERROR, "Cannot write to temporary pass2 file.\n"); + return AVERROR(EIO); + } } close(fd); |