Browse Source

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]
tags/n3.3
Diego Biurrun 10 years ago
parent
commit
f7d183f084
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/libxvid_rc.c

+ 4
- 1
libavcodec/libxvid_rc.c View File

@@ -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);


Loading…
Cancel
Save