diff mbox series

[FFmpeg-devel] avfilter/asrc_anullsrc: fix allowed range for sample_rate

Message ID 20231122213420.9987-1-jamrial@gmail.com
State Accepted
Commit 0008e1c5d5fff3ddc06c74e0c5b627e8ad2eeb17
Headers show
Series [FFmpeg-devel] avfilter/asrc_anullsrc: fix allowed range for sample_rate | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Nov. 22, 2023, 9:34 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavfilter/asrc_anullsrc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol Nov. 22, 2023, 10:38 p.m. UTC | #1
LGTM
diff mbox series

Patch

diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c
index a8887da62d..a48728eaf0 100644
--- a/libavfilter/asrc_anullsrc.c
+++ b/libavfilter/asrc_anullsrc.c
@@ -51,8 +51,8 @@  typedef struct ANullContext {
 static const AVOption anullsrc_options[]= {
     { "channel_layout", "set channel_layout", OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = "stereo"}, 0, 0, FLAGS },
     { "cl",             "set channel_layout", OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = "stereo"}, 0, 0, FLAGS },
-    { "sample_rate",    "set sample rate",    OFFSET(sample_rate)   , AV_OPT_TYPE_INT, {.i64 = 44100}, 0, 0, FLAGS },
-    { "r",              "set sample rate",    OFFSET(sample_rate)   , AV_OPT_TYPE_INT, {.i64 = 44100}, 0, 0, FLAGS },
+    { "sample_rate",    "set sample rate",    OFFSET(sample_rate)   , AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT_MAX, FLAGS },
+    { "r",              "set sample rate",    OFFSET(sample_rate)   , AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT_MAX, FLAGS },
     { "nb_samples",     "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 1024}, 1, UINT16_MAX, FLAGS },
     { "n",              "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 1024}, 1, UINT16_MAX, FLAGS },
     { "duration",       "set the audio duration",                        OFFSET(duration),   AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },