Browse code

Fix segfault with non existing input files.

Originally committed as revision 14369 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2008/07/25 00:47:28
Showing 1 changed files
... ...
@@ -120,6 +120,10 @@ int main(int argc,char* argv[]){
120 120
 
121 121
     f[0]= fopen(argv[1], "rb");
122 122
     f[1]= fopen(argv[2], "rb");
123
+    if(!f[0] || !f[1]){
124
+        fprintf(stderr, "couldnt open input files\n");
125
+        return -1;
126
+    }
123 127
     fseek(f[shift<0], shift < 0 ? -shift : shift, SEEK_SET);
124 128
 
125 129
     fseek(f[0],skip_bytes,SEEK_CUR);