summaryrefslogtreecommitdiff
path: root/libavcodec/libxvid_rc.c
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2015-02-11 00:27:35 +0530
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-02-17 12:18:20 -0500
commita1e2c47cd4fdaa64beda7e6dfa623b65c46f5012 (patch)
tree4150105254e15ed7101df58ab0b843cf6a2f4fbb /libavcodec/libxvid_rc.c
parent18f4fa251b0eb36392839f5bf6180f280dc04d8d (diff)
libxvid: Return meaningful error messages
Diffstat (limited to 'libavcodec/libxvid_rc.c')
-rw-r--r--libavcodec/libxvid_rc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/libxvid_rc.c b/libavcodec/libxvid_rc.c
index 68140a63ba..26f3c495c1 100644
--- a/libavcodec/libxvid_rc.c
+++ b/libavcodec/libxvid_rc.c
@@ -52,7 +52,7 @@ int ff_tempfile(const char *prefix, char **filename)
/* -----common section-----*/
if (!(*filename)) {
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
- return -1;
+ return AVERROR(ENOMEM);
}
#if !HAVE_MKSTEMP
fd = avpriv_open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
@@ -67,7 +67,7 @@ int ff_tempfile(const char *prefix, char **filename)
/* -----common section-----*/
if (fd < 0) {
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
- return -1;
+ return AVERROR(EIO);
}
return fd; /* success */
}
@@ -80,9 +80,9 @@ av_cold int ff_xvid_rate_control_init(MpegEncContext *s)
xvid_plugin_2pass2_t xvid_2pass2 = { 0 };
fd = ff_tempfile("xvidrc.", &tmp_name);
- if (fd == -1) {
+ if (fd < 0) {
av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n");
- return -1;
+ return fd;
}
for (i = 0; i < s->rc_context.num_entries; i++) {