summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2014-08-14 14:59:50 -0700
committerDeb Mukherjee <debargha@google.com>2014-08-15 09:20:54 -0700
commit4851b99bf181f5c0667a7a97d3685773126f7b51 (patch)
treeecfabdfb17a4e352d4aed598aefdb425e91f7695
parent54f8cb78c6eecc78e666e6c39b64afcdf03591f8 (diff)
downloadlibvpx-4851b99bf181f5c0667a7a97d3685773126f7b51.tar
libvpx-4851b99bf181f5c0667a7a97d3685773126f7b51.tar.gz
libvpx-4851b99bf181f5c0667a7a97d3685773126f7b51.tar.bz2
libvpx-4851b99bf181f5c0667a7a97d3685773126f7b51.zip
Removes fileno check to prevent valgrind error
Explicitly makes the fileptr null when close source is called on a temporary file. This avoids a valgrind error. Change-Id: I9c364290eeb6842fde946dd9bf817814c7178aaa
-rw-r--r--test/video_source.h7
-rw-r--r--test/y4m_test.cc4
2 files changed, 3 insertions, 8 deletions
diff --git a/test/video_source.h b/test/video_source.h
index c924f964f..84bfa8e53 100644
--- a/test/video_source.h
+++ b/test/video_source.h
@@ -92,12 +92,7 @@ class TempOutFile {
protected:
void CloseFile() {
if (file_) {
- // Close if file pointer is associated with an open file
-#if defined(_WIN32)
- if (file_->_ptr != NULL) fclose(file_);
-#else
- if (fileno(file_) != -1) fclose(file_);
-#endif
+ fclose(file_);
file_ = NULL;
}
}
diff --git a/test/y4m_test.cc b/test/y4m_test.cc
index d4a2ede20..17cd78207 100644
--- a/test/y4m_test.cc
+++ b/test/y4m_test.cc
@@ -141,11 +141,11 @@ class Y4mVideoWriteTest
Y4mVideoWriteTest() {}
virtual ~Y4mVideoWriteTest() {
- CloseSource();
delete tmpfile_;
+ input_file_ = NULL;
}
- virtual void ReplaceInputFile(FILE *input_file) {
+ void ReplaceInputFile(FILE *input_file) {
CloseSource();
frame_ = 0;
input_file_ = input_file;