[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#715843: Bug report on dvbcut: dvbcut crashes with exit status 139



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
from the commandline parameters and the core dump sent by Alexandre Rebert it seems
that dvbcut got called this way:

  /usr/bin/dvbcut -idx

But dvbcut expects here another parameter specifiying the filename to store the index.

Following patch tries to avoid this crash by moving the increment from the condition
to the assignment one line later (when all conditions are fulfilled).

With this patch dvbcut shows its command line usage information.

Kind regards,
Bernhard


- --- dvbcut-0.5.4+svn178.orig/src/main.cpp
+++ dvbcut-0.5.4+svn178/src/main.cpp
@@ -108,18 +108,18 @@ main(int argc, char *argv[]) {
         generateidx = true;
       else if (strncmp(argv[i], "-voracious", n) == 0)
        dvbcut::cache_friendly = false;
- -      else if (strncmp(argv[i], "-idx", n) == 0 && ++i < argc)
- -        idxfilename = argv[i];
- -      else if (strncmp(argv[i], "-exp", n) == 0 && ++i < argc)
- -        expfilename = argv[i];
- -      else if (strncmp(argv[i], "-format", n) == 0 && ++i < argc)
- -        exportformat = atoi(argv[i]);
- -      else if (strncmp(argv[i], "-automarker", n) == 0 && ++i < argc) {
- -        int bofeof = atoi(argv[i]);
+      else if (strncmp(argv[i], "-idx", n) == 0 && (i+1) < argc)
+        idxfilename = argv[++i];
+      else if (strncmp(argv[i], "-exp", n) == 0 && (i+1) < argc)
+        expfilename = argv[++i];
+      else if (strncmp(argv[i], "-format", n) == 0 && (i+1) < argc)
+        exportformat = atoi(argv[++i]);
+      else if (strncmp(argv[i], "-automarker", n) == 0 && (i+1) < argc) {
+        int bofeof = atoi(argv[++i]);
         start_bof = (bofeof&1)==1;
         stop_eof  = (bofeof&2)==2;
- -      } else if (strncmp(argv[i], "-cut", n) == 0 && ++i < argc) {
- -        char *pch = strtok(argv[i],",-|;");
+      } else if (strncmp(argv[i], "-cut", n) == 0 && (i+1) < argc) {
+        char *pch = strtok(argv[++i],",-|;");
         while(pch) {
           if(strlen(pch))
             cutlist.push_back((std::string)pch);    
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTsajaAAoJEOlvol+DpkHm1WIIAKdBj7eA1JIdDYaLuL1v+igZ
JTihnO1nJ/d03Y9C1UE7whOvSQwxXBMO3ZHYOjahIJumz0ijZDJGzVn+ce0Ug/ZS
LeXfX/Yxx7FbmCWV57DajsxSi9d9mbGTw6v6E9cDeQOzLUa4UN5dWh3NZnnNXW+b
y5vDUdN1XeknYjvpCg8SSRRK1qtI9t+ySjefATnJ1X3udCXnbusdDDwaMIvVVEBr
4j+Q56WOZ0K6AoUHwjdFF3m3bmrCnMlXJUKWiokqIeKI76nnqJyNRWHm6L5Da5XM
caWHEgLmeoNt7EHoZnR0iGmuu+P7msY/sCrn+674Dxa6CA3M3OThcQmG2SUaKlY=
=7mpW
-----END PGP SIGNATURE-----


Reply to: