[FFmpeg-cvslog] r14369 - trunk/tests/tiny_psnr.c

michael subversion
Thu Jul 24 17:47:29 CEST 2008


Author: michael
Date: Thu Jul 24 17:47:28 2008
New Revision: 14369

Log:
Fix segfault with non existing input files.


Modified:
   trunk/tests/tiny_psnr.c

Modified: trunk/tests/tiny_psnr.c
==============================================================================
--- trunk/tests/tiny_psnr.c	(original)
+++ trunk/tests/tiny_psnr.c	Thu Jul 24 17:47:28 2008
@@ -120,6 +120,10 @@ int main(int argc,char* argv[]){
 
     f[0]= fopen(argv[1], "rb");
     f[1]= fopen(argv[2], "rb");
+    if(!f[0] || !f[1]){
+        fprintf(stderr, "couldnt open input files\n");
+        return -1;
+    }
     fseek(f[shift<0], shift < 0 ? -shift : shift, SEEK_SET);
 
     fseek(f[0],skip_bytes,SEEK_CUR);




More information about the ffmpeg-cvslog mailing list