summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-30 22:12:13 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-03-30 23:35:18 +0200
commit477ba8f9391f779b7927305c89b5c24120930925 (patch)
tree5a7f5d0d9f6c7146b4696aa875969b2eb74b3271 /libavfilter
parentfe46d92c15ca7bd35324ff667c433a06af8b845c (diff)
downloadffmpeg-streaming-477ba8f9391f779b7927305c89b5c24120930925.zip
ffmpeg-streaming-477ba8f9391f779b7927305c89b5c24120930925.tar.gz
avfilter/af_chorus & aecho: Handle NULL return from av_strtok()
Fixes CID1396260 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_aecho.c3
-rw-r--r--libavfilter/af_chorus.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/af_aecho.c b/libavfilter/af_aecho.c
index 82049e9..cfaea3d 100644
--- a/libavfilter/af_aecho.c
+++ b/libavfilter/af_aecho.c
@@ -77,7 +77,8 @@ static void fill_items(char *item_str, int *nb_items, float *items)
for (i = 0; i < *nb_items; i++) {
char *tstr = av_strtok(p, "|", &saveptr);
p = NULL;
- new_nb_items += sscanf(tstr, "%f", &items[i]) == 1;
+ if (tstr)
+ new_nb_items += sscanf(tstr, "%f", &items[new_nb_items]) == 1;
}
*nb_items = new_nb_items;
diff --git a/libavfilter/af_chorus.c b/libavfilter/af_chorus.c
index c596164..87c8290 100644
--- a/libavfilter/af_chorus.c
+++ b/libavfilter/af_chorus.c
@@ -96,7 +96,8 @@ static void fill_items(char *item_str, int *nb_items, float *items)
for (i = 0; i < *nb_items; i++) {
char *tstr = av_strtok(p, "|", &saveptr);
p = NULL;
- new_nb_items += sscanf(tstr, "%f", &items[i]) == 1;
+ if (tstr)
+ new_nb_items += sscanf(tstr, "%f", &items[new_nb_items]) == 1;
}
*nb_items = new_nb_items;
OpenPOWER on IntegriCloud