postproc: fix null pointer dereference with invalid option strings
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Dec 2013 21:24:51 +0000 (22:24 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Dec 2013 21:28:42 +0000 (22:28 +0100)
Fixes CID1135760
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libpostproc/postprocess.c

index b34943f..da586ff 100644 (file)
@@ -719,6 +719,10 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality)
         if(filterToken == NULL) break;
         p+= strlen(filterToken) + 1; // p points to next filterToken
         filterName= strtok(filterToken, optionDelimiters);
+        if (filterName == NULL) {
+            ppMode->error++;
+            break;
+        }
         av_log(NULL, AV_LOG_DEBUG, "pp: %s::%s\n", filterToken, filterName);
 
         if(*filterName == '-'){