]> granicus.if.org Git - libvpx/commitdiff
Removes fileno check to prevent valgrind error
authorDeb Mukherjee <debargha@google.com>
Thu, 14 Aug 2014 21:59:50 +0000 (14:59 -0700)
committerDeb Mukherjee <debargha@google.com>
Fri, 15 Aug 2014 16:20:54 +0000 (09:20 -0700)
Explicitly makes the fileptr null when close source is called
on a temporary file. This avoids a valgrind error.

Change-Id: I9c364290eeb6842fde946dd9bf817814c7178aaa

test/video_source.h
test/y4m_test.cc

index c924f964f8cbd33311a708ebabedc0b65f568c5f..84bfa8e53acaa347261588475c5a23737faeb4fa 100644 (file)
@@ -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;
     }
   }
index d4a2ede20c82b2203e5990dda98661d4a0413f0d..17cd78207546ebb3c3d10e7c8979ee573ad0ba5c 100644 (file)
@@ -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;