1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

cmdutils: fix success path

Since commit 934f2d2f5c,
cmdutils_read_file() prints a confusing message on success:

IO error: Success

This is because the error message is printed on the success path as
well. Add the missing condition so that it is only printed on error.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Jean Delvare 2015-02-11 14:18:27 +01:00 committed by Michael Niedermayer
parent edf217ebb7
commit 194165aed8

View File

@ -1912,7 +1912,8 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
}
out:
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", av_err2str(ret));
if (ret < 0)
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", av_err2str(ret));
fclose(f);
return ret;
}