[FFmpeg-devel] [PATCH v1] avfilter/asrc_anoisesrc: change type to TYPE_INT64 for color is int64_t

lance.lmwang at gmail.com lance.lmwang at gmail.com
Sat Oct 26 05:09:04 EEST 2019


From: Limin Wang <lance.lmwang at gmail.com>

Or it'll cause invalid color and s->filter is NULL.
Please reproduce it with below command on big endian system:
$ ./ffmpeg -f lavfi -i "anoisesrc=d=60:c=1:r=48000" -f s16le -c:a pcm_s16le  -f null  -
Segmentation fault (core dumped)

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavfilter/asrc_anoisesrc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/asrc_anoisesrc.c b/libavfilter/asrc_anoisesrc.c
index 78f0af4fde..8a6ef89dd1 100644
--- a/libavfilter/asrc_anoisesrc.c
+++ b/libavfilter/asrc_anoisesrc.c
@@ -60,9 +60,9 @@ static const AVOption anoisesrc_options[] = {
     { "a",            "set amplitude",    OFFSET(amplitude),    AV_OPT_TYPE_DOUBLE,    {.dbl = 1.},        0.,  1.,         FLAGS },
     { "duration",     "set duration",     OFFSET(duration),     AV_OPT_TYPE_DURATION,  {.i64 =  0},         0,  INT64_MAX,  FLAGS },
     { "d",            "set duration",     OFFSET(duration),     AV_OPT_TYPE_DURATION,  {.i64 =  0},         0,  INT64_MAX,  FLAGS },
-    { "color",        "set noise color",  OFFSET(color),        AV_OPT_TYPE_INT,       {.i64 =  0},         0,  NM_NB - 1,  FLAGS, "color" },
-    { "colour",       "set noise color",  OFFSET(color),        AV_OPT_TYPE_INT,       {.i64 =  0},         0,  NM_NB - 1,  FLAGS, "color" },
-    { "c",            "set noise color",  OFFSET(color),        AV_OPT_TYPE_INT,       {.i64 =  0},         0,  NM_NB - 1,  FLAGS, "color" },
+    { "color",        "set noise color",  OFFSET(color),        AV_OPT_TYPE_INT64,     {.i64 =  0},         0,  NM_NB - 1,  FLAGS, "color" },
+    { "colour",       "set noise color",  OFFSET(color),        AV_OPT_TYPE_INT64,     {.i64 =  0},         0,  NM_NB - 1,  FLAGS, "color" },
+    { "c",            "set noise color",  OFFSET(color),        AV_OPT_TYPE_INT64,     {.i64 =  0},         0,  NM_NB - 1,  FLAGS, "color" },
     {     "white",    0,                  0,                    AV_OPT_TYPE_CONST,     {.i64 = NM_WHITE},   0,  0,          FLAGS, "color" },
     {     "pink",     0,                  0,                    AV_OPT_TYPE_CONST,     {.i64 = NM_PINK},    0,  0,          FLAGS, "color" },
     {     "brown",    0,                  0,                    AV_OPT_TYPE_CONST,     {.i64 = NM_BROWN},   0,  0,          FLAGS, "color" },
-- 
2.21.0



More information about the ffmpeg-devel mailing list