From 91a4abd8f544219ce85fb1b1ced9f1389d94faaa Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Mon, 21 Jun 2010 01:05:30 +0000 Subject: fail if input and output are the same Originally committed as revision 23672 to svn://svn.ffmpeg.org/ffmpeg/trunk --- tools/qt-faststart.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/qt-faststart.c') diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c index 7bcd5b72bd..ace4c113c8 100644 --- a/tools/qt-faststart.c +++ b/tools/qt-faststart.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef __MINGW32__ #define fseeko(x,y,z) fseeko64(x,y,z) @@ -98,6 +99,11 @@ int main(int argc, char *argv[]) return 0; } + if (!strcmp(argv[1], argv[2])) { + fprintf(stderr, "input and output files need to be different\n"); + return 1; + } + infile = fopen(argv[1], "rb"); if (!infile) { perror(argv[1]); -- cgit v1.2.3