summaryrefslogtreecommitdiff
path: root/libavcodec/libxvid_rc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-04 01:09:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-04 05:18:45 +0100
commit25f35df11583800ee296effd42c51c65e9f3ef72 (patch)
tree2a2da24d7eca9e3b919b8e1f103b14790f896b93 /libavcodec/libxvid_rc.c
parent3b46daa31f566f9c6ef1518c1767b12e0ab2f62a (diff)
downloadffmpeg-25f35df11583800ee296effd42c51c65e9f3ef72.tar.gz
xvid_rc: check that write() succeeded.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libxvid_rc.c')
-rw-r--r--libavcodec/libxvid_rc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/libxvid_rc.c b/libavcodec/libxvid_rc.c
index 10a7c1cb3e..08d306e82f 100644
--- a/libavcodec/libxvid_rc.c
+++ b/libavcodec/libxvid_rc.c
@@ -59,7 +59,10 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
rce->skip_count, (rce->i_tex_bits + rce->p_tex_bits + rce->misc_bits+7)/8, (rce->header_bits+rce->mv_bits+7)/8);
//av_log(NULL, AV_LOG_ERROR, "%s\n", tmp);
- write(fd, tmp, strlen(tmp));
+ if (write(fd, tmp, strlen(tmp)) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error %s writing 2pass logfile\n", strerror(errno));
+ return AVERROR(errno);
+ }
}
close(fd);