diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-07-24 15:47:28 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-07-24 15:47:28 +0000 |
commit | e740c796d801d38eaaddfd337a18cfd0df8a5756 (patch) | |
tree | 63d6706848629bdfce232acd96a8b51af8bd152a /tests | |
parent | a53b5450685c18d1aa9f81d20c8dbd39f4c63757 (diff) | |
download | ffmpeg-e740c796d801d38eaaddfd337a18cfd0df8a5756.tar.gz |
Fix segfault with non existing input files.
Originally committed as revision 14369 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tiny_psnr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index 31a7a1b5e4..7a83dd59c5 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -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); |