aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc')
-rw-r--r--tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc b/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
index a34c64d328..a758bb92aa 100644
--- a/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
+++ b/tensorflow/contrib/ffmpeg/default/ffmpeg_lib.cc
@@ -69,7 +69,10 @@ bool IsBinaryInstalled(const string& binary_name) {
for (const string& dir : str_util::Split(path, ':')) {
const string binary_path = io::JoinPath(dir, binary_name);
char absolute_path[PATH_MAX + 1];
- ::realpath(binary_path.c_str(), absolute_path);
+ if (::realpath(binary_path.c_str(), absolute_path) == NULL) {
+ LOG(ERROR) << "Invalid binary path: " << binary_path;
+ return false;
+ }
struct stat statinfo;
int result = ::stat(absolute_path, &statinfo);
if (result < 0) {