From f7d183f08472e566a2e6b62a80e200a12670ed0e Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 8 Dec 2015 10:22:15 +0100 Subject: [PATCH] libxvid: Check return value of write() call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libavcodec/libxvid_rc.c:106:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] --- libavcodec/libxvid_rc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);