PR #25808 opened by trevorHansen
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25808
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25808.patch

I ran into this while trying to fuzz FFmpeg's audio decoders: for these
decoders `tools/target_dec_fuzzer` aborts on short inputs (for sipr, ra_144
and siren, even random 64-byte ones), so fuzzing keeps hitting the same
assertion instead of getting into the decoders.

My fuzzing only hit four of them (imc, ra_144, sipr and siren). It is a
common pattern, though, fixed three times before for aac, misc4 and
nellymoser, so I looked for other decoders with the same flaw: bmv_audio,
adpcm_vima, ra_288, sbc and ws_snd1 fail the same way with small handcrafted
packets.

OSS-Fuzz builds the decoder fuzzers for all ten of these (each has a coverage
report from 2026-11-06), so the crashes have probably been reported already,
perhaps in issues that are still private.

Decoders that set `AV_CODEC_CAP_CHANNEL_CONF` are exempt from the sample rate
check in `avcodec_open2()`, but these ten never set a sample rate themselves:
adpcm_vima, bmv_audio, imc, ra_144, ra_288, rka, sbc, sipr, siren and ws_snd1.
Opened without one (as `tools/target_dec_fuzzer` does for inputs of 1024 bytes
or less), they output frames with `sample_rate == 0`, which `frame_validate()`
turns into `AVERROR_BUG`, and the fuzzer's `av_assert0(ret != AVERROR_BUG)`
aborts.

The first commit makes them error out cleanly with `AVERROR_INVALIDDATA`
before outputting a frame, the same check the AAC decoder got in e711e60827
(the misc4 and nellymoser fixes are 32eb07bb83 and 23918b3200). rka is
included because it follows the same pattern; no failing input for it was
found.

The second commit adds `tests/api/api-sample-rate-test` with one FATE test per
decoder (`fate-api-sample-rate-<decoder>`, run when that decoder is enabled).
Each decodes one small built-in packet without a sample rate, which must fail
cleanly, and at 8000 Hz, which must output samples. No external samples are
needed.

Testing:
- the nine new FATE tests pass with the fix and all fail (`AVERROR_BUG`) 
without it
- the failing fuzzer inputs for the nine affected decoders no longer abort
  (target_dec_fuzzer, x86-64, ASan)



>From cf9c462d5ec8271a9f5bd4bdf1684e9adff1d42b Mon Sep 17 00:00:00 2001
From: Trevor Hansen <[email protected]>
Date: Fri, 6 Nov 2026 23:35:15 +1100
Subject: [PATCH 1/2] avcodec: reject decoded frames without a valid sample
 rate

Later code will turn this into AVERROR_BUG.

These decoders set AV_CODEC_CAP_CHANNEL_CONF, so avcodec_open2() does not
require a sample rate, but none of them sets one itself. Opened without a
sample rate, they output frames with sample_rate == 0, which
frame_validate() rejects with AVERROR_BUG. Error out cleanly instead, as
the AAC decoder does since e711e60827.

The check is added to bmv_audio, adpcm_vima, imc, ra_144, ra_288, rka, sbc,
sipr, siren and ws_snd1. rka is included because it follows the same
pattern; no failing input for it was found. msnsiren shares the siren
decode function and so gets the check too, but it was not affected: it
derives its frame size from the sample rate, so without one it reads no
bits and already fails with AVERROR_INVALIDDATA.

The same problem was fixed one decoder at a time for aac (e711e60827),
misc4 (32eb07bb83) and nellymoser (23918b3200).

Fixes: assertion failure
Fixes: ffmpeg_AV_CODEC_ID_ADPCM_VIMA_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_BMV_AUDIO_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_IMC_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_RA_144_DEC_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_RA_288_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_SBC_DEC_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_SIPR_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_SIREN_fuzzer
Fixes: ffmpeg_AV_CODEC_ID_WS_SND1_fuzzer
Signed-off-by: Trevor Hansen <[email protected]>
---
 libavcodec/bmvaudio.c | 6 ++++++
 libavcodec/imc.c      | 6 ++++++
 libavcodec/ra144dec.c | 6 ++++++
 libavcodec/ra288.c    | 6 ++++++
 libavcodec/rka.c      | 6 ++++++
 libavcodec/sbcdec.c   | 6 ++++++
 libavcodec/sipr.c     | 6 ++++++
 libavcodec/siren.c    | 6 ++++++
 libavcodec/vima.c     | 6 ++++++
 libavcodec/ws-snd1.c  | 6 ++++++
 10 files changed, 60 insertions(+)

diff --git a/libavcodec/bmvaudio.c b/libavcodec/bmvaudio.c
index fc211732bbb..ecd26dc4fa0 100644
--- a/libavcodec/bmvaudio.c
+++ b/libavcodec/bmvaudio.c
@@ -56,6 +56,12 @@ static int bmv_aud_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
         return AVERROR_INVALIDDATA;
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = total_blocks * 32;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 014f9bbfaa7..0d9ac75f19a 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -978,6 +978,12 @@ static int imc_decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
         return AVERROR_INVALIDDATA;
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = COEFFS;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c
index 943e84e1f85..12a39854b0e 100644
--- a/libavcodec/ra144dec.c
+++ b/libavcodec/ra144dec.c
@@ -84,6 +84,12 @@ static int ra144_decode_frame(AVCodecContext * avctx, 
AVFrame *frame,
         return AVERROR_INVALIDDATA;
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = NBLOCKS * BLOCKSIZE;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 550af7f29f2..781c412226a 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -165,6 +165,12 @@ static int ra288_decode_frame(AVCodecContext * avctx, 
AVFrame *frame,
     if (ret < 0)
         return ret;
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
diff --git a/libavcodec/rka.c b/libavcodec/rka.c
index 975ff6dedf2..37ac339e21a 100644
--- a/libavcodec/rka.c
+++ b/libavcodec/rka.c
@@ -862,6 +862,12 @@ static int rka_decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
             return ret;
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     frame->nb_samples = s->frame_samples;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index e7ddef76992..c1f1084be47 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -342,6 +342,12 @@ static int sbc_decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
     SBCDecContext *sbc = avctx->priv_data;
     int ret, frame_length;
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     frame_length = sbc_unpack_frame(avpkt->data, &sbc->frame, avpkt->size);
     if (frame_length <= 0)
         return frame_length;
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
index ebd7dab03c7..0bd0bd3ff64 100644
--- a/libavcodec/sipr.c
+++ b/libavcodec/sipr.c
@@ -539,6 +539,12 @@ static int sipr_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
         return AVERROR_INVALIDDATA;
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = mode_par->frames_per_packet * subframe_size *
                         mode_par->subframe_count;
diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index e76f21bc7e3..f7529774a34 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -712,6 +712,12 @@ static int siren_decode(AVCodecContext *avctx, AVFrame 
*frame,
     int frame_error = 0, rate_control = 0;
     int bits_per_frame;
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (s->microsoft) {
         bits_per_frame  = avctx->sample_rate / 50;
 
diff --git a/libavcodec/vima.c b/libavcodec/vima.c
index bde7033c2cb..dcae59828ce 100644
--- a/libavcodec/vima.c
+++ b/libavcodec/vima.c
@@ -156,6 +156,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
         pcm_data[1]     = get_sbits(&gb, 16);
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     frame->nb_samples = samples;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index 0e97ef21659..63eba12abb6 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -79,6 +79,12 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
         return AVERROR_INVALIDDATA;
     }
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = out_size;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-- 
2.54.0


>From c8e67c2cd0d8f9f3c4ce6711897445736b41f43b Mon Sep 17 00:00:00 2001
From: Trevor Hansen <[email protected]>
Date: Fri, 6 Nov 2026 23:55:02 +1100
Subject: [PATCH 2/2] tests/api: add a test for decoders opened without a
 sample rate

For each decoder that sets AV_CODEC_CAP_CHANNEL_CONF but never sets a
sample rate, decode one packet once without a sample rate, which must fail
cleanly instead of returning AVERROR_BUG, and once with a sample rate of
8000, which must output samples. There is one FATE test per decoder, run
when that decoder is enabled. No external samples are needed.

Signed-off-by: Trevor Hansen <[email protected]>
---
 tests/api/Makefile                        |   1 +
 tests/api/api-sample-rate-test.c          | 171 ++++++++++++++++++++++
 tests/fate/api.mak                        |  17 +++
 tests/ref/fate/api-sample-rate-adpcm_vima |   2 +
 tests/ref/fate/api-sample-rate-bmv_audio  |   2 +
 tests/ref/fate/api-sample-rate-imc        |   2 +
 tests/ref/fate/api-sample-rate-real_144   |   2 +
 tests/ref/fate/api-sample-rate-real_288   |   2 +
 tests/ref/fate/api-sample-rate-sbc        |   2 +
 tests/ref/fate/api-sample-rate-sipr       |   2 +
 tests/ref/fate/api-sample-rate-siren      |   2 +
 tests/ref/fate/api-sample-rate-ws_snd1    |   2 +
 12 files changed, 207 insertions(+)
 create mode 100644 tests/api/api-sample-rate-test.c
 create mode 100644 tests/ref/fate/api-sample-rate-adpcm_vima
 create mode 100644 tests/ref/fate/api-sample-rate-bmv_audio
 create mode 100644 tests/ref/fate/api-sample-rate-imc
 create mode 100644 tests/ref/fate/api-sample-rate-real_144
 create mode 100644 tests/ref/fate/api-sample-rate-real_288
 create mode 100644 tests/ref/fate/api-sample-rate-sbc
 create mode 100644 tests/ref/fate/api-sample-rate-sipr
 create mode 100644 tests/ref/fate/api-sample-rate-siren
 create mode 100644 tests/ref/fate/api-sample-rate-ws_snd1

diff --git a/tests/api/Makefile b/tests/api/Makefile
index c411e82e5f1..90e03dff88d 100644
--- a/tests/api/Makefile
+++ b/tests/api/Makefile
@@ -11,6 +11,7 @@ APITESTPROGS-$(call DEMDEC, H263, H263) += api-band
 APITESTPROGS-$(HAVE_THREADS) += api-threadmessage
 APITESTPROGS-$(CONFIG_AVCODEC) += api-enc-info
 APITESTPROGS-$(CONFIG_PCM_S16LE_DECODER) += api-skip-samples
+APITESTPROGS-$(CONFIG_AVCODEC) += api-sample-rate
 APITESTPROGS-$(call ALLYES, H261_ENCODER H261_PARSER) += api-enc-parser
 APITESTPROGS += $(APITESTPROGS-yes)
 
diff --git a/tests/api/api-sample-rate-test.c b/tests/api/api-sample-rate-test.c
new file mode 100644
index 00000000000..2b0c8407978
--- /dev/null
+++ b/tests/api/api-sample-rate-test.c
@@ -0,0 +1,171 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * Decode one packet with the named decoder, one of the decoders that set
+ * AV_CODEC_CAP_CHANNEL_CONF but never set a sample rate, once without a
+ * sample rate and once with one, and print what each decode returns.
+ * Without a sample rate the decoder must fail cleanly instead of outputting
+ * a frame that is then turned into AVERROR_BUG.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "libavcodec/avcodec.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/macros.h"
+
+typedef struct TestCase {
+    const char *name;
+    int packet_size;
+    int block_align;
+    int noise;  /* fill the packet with pseudo-random bytes instead of zeros */
+    void (*fill)(uint8_t *data);
+} TestCase;
+
+static void fill_noise(uint8_t *data, int size)
+{
+    uint32_t state = 1;
+
+    for (int i = 0; i < size; i++) {
+        state = state * 1664525 + 1013904223;
+        data[i] = state >> 24;
+    }
+}
+
+static void fill_bmv_audio(uint8_t *data)
+{
+    data[0] = 1; /* one block */
+}
+
+static void fill_adpcm_vima(uint8_t *data)
+{
+    AV_WB32(data, 16); /* samples */
+}
+
+static void fill_ws_snd1(uint8_t *data)
+{
+    AV_WL16(data,     16); /* output size */
+    AV_WL16(data + 2, 16); /* input size, equal: raw samples follow */
+    memset(data + 4, 0x80, 16);
+}
+
+static void fill_sbc(uint8_t *data)
+{
+    data[0] = 0xAD; /* mSBC syncword */
+    data[3] = 0xC5; /* CRC of the header and the all-zero scale factors */
+}
+
+static const TestCase tests[] = {
+    { "adpcm_vima", 40, 0,  0, fill_adpcm_vima },
+    { "bmv_audio",  66, 0,  0, fill_bmv_audio  },
+    { "imc",        64, 0                      },
+    { "real_144",   20, 0                      },
+    { "real_288",   38, 38                     },
+    { "sbc",        57, 0,  0, fill_sbc        }, /* one mSBC frame */
+    { "sipr",       20, 20                     },
+    { "siren",      40, 0,  1                  }, /* one Vivo packet */
+    { "ws_snd1",    20, 0,  0, fill_ws_snd1    },
+};
+
+/* Returns the number of samples decoded, or a negative error code. */
+static int decode_one(const TestCase *t, int sample_rate)
+{
+    const AVCodec *codec = avcodec_find_decoder_by_name(t->name);
+    AVCodecContext *ctx = NULL;
+    AVPacket *pkt = NULL;
+    AVFrame *frame = NULL;
+    int nb_samples = 0;
+    int ret;
+
+    if (!codec)
+        return AVERROR_DECODER_NOT_FOUND;
+
+    ctx   = avcodec_alloc_context3(codec);
+    pkt   = av_packet_alloc();
+    frame = av_frame_alloc();
+    if (!ctx || !pkt || !frame) {
+        ret = AVERROR(ENOMEM);
+        goto end;
+    }
+
+    ctx->sample_rate = sample_rate;
+    ctx->block_align = t->block_align;
+    ret = avcodec_open2(ctx, codec, NULL);
+    if (ret < 0)
+        goto end;
+
+    ret = av_new_packet(pkt, t->packet_size);
+    if (ret < 0)
+        goto end;
+    memset(pkt->data, 0, pkt->size);
+    if (t->noise)
+        fill_noise(pkt->data, pkt->size);
+    if (t->fill)
+        t->fill(pkt->data);
+
+    ret = avcodec_send_packet(ctx, pkt);
+    if (ret < 0)
+        goto end;
+    while ((ret = avcodec_receive_frame(ctx, frame)) >= 0) {
+        nb_samples += frame->nb_samples;
+        av_frame_unref(frame);
+    }
+    if (ret == AVERROR(EAGAIN))
+        ret = nb_samples;
+
+end:
+    av_frame_free(&frame);
+    av_packet_free(&pkt);
+    avcodec_free_context(&ctx);
+    return ret;
+}
+
+int main(int argc, char **argv)
+{
+    static const int rates[] = { 0, 8000 };
+    const TestCase *t = NULL;
+    int bug = 0;
+
+    if (argc != 2) {
+        fprintf(stderr, "Usage: %s <decoder>\n", argv[0]);
+        return 1;
+    }
+    for (int i = 0; i < FF_ARRAY_ELEMS(tests); i++)
+        if (!strcmp(tests[i].name, argv[1]))
+            t = &tests[i];
+    if (!t) {
+        fprintf(stderr, "No test for decoder %s\n", argv[1]);
+        return 1;
+    }
+
+    for (int i = 0; i < FF_ARRAY_ELEMS(rates); i++) {
+        int ret = decode_one(t, rates[i]);
+
+        printf("sample rate %4d: ", rates[i]);
+        if (ret >= 0)
+            printf("%d samples\n", ret);
+        else if (ret == AVERROR_INVALIDDATA)
+            printf("invalid data\n");
+        else
+            printf("%s\n", av_err2str(ret));
+        bug |= ret == AVERROR_BUG;
+    }
+    return bug;
+}
diff --git a/tests/fate/api.mak b/tests/fate/api.mak
index 1659c7979c0..137851a1f4e 100644
--- a/tests/fate/api.mak
+++ b/tests/fate/api.mak
@@ -16,6 +16,23 @@ FATE_API_LIBAVCODEC-$(CONFIG_PCM_S16LE_DECODER) += 
fate-api-skip-samples
 fate-api-skip-samples: $(APITESTSDIR)/api-skip-samples-test$(EXESUF)
 fate-api-skip-samples: CMD = run $(APITESTSDIR)/api-skip-samples-test$(EXESUF)
 
+# $(1): decoder config name, $(2): decoder name
+define FATE_API_SAMPLE_RATE
+FATE_API_LIBAVCODEC-$(CONFIG_$(1)_DECODER) += fate-api-sample-rate-$(2)
+fate-api-sample-rate-$(2): $(APITESTSDIR)/api-sample-rate-test$(EXESUF)
+fate-api-sample-rate-$(2): CMD = run 
$(APITESTSDIR)/api-sample-rate-test$(EXESUF) $(2)
+endef
+
+$(eval $(call FATE_API_SAMPLE_RATE,ADPCM_VIMA,adpcm_vima))
+$(eval $(call FATE_API_SAMPLE_RATE,BMV_AUDIO,bmv_audio))
+$(eval $(call FATE_API_SAMPLE_RATE,IMC,imc))
+$(eval $(call FATE_API_SAMPLE_RATE,RA_144,real_144))
+$(eval $(call FATE_API_SAMPLE_RATE,RA_288,real_288))
+$(eval $(call FATE_API_SAMPLE_RATE,SBC,sbc))
+$(eval $(call FATE_API_SAMPLE_RATE,SIPR,sipr))
+$(eval $(call FATE_API_SAMPLE_RATE,SIREN,siren))
+$(eval $(call FATE_API_SAMPLE_RATE,WS_SND1,ws_snd1))
+
 FATE_API_LIBAVCODEC-$(CONFIG_MOVTEXT_ENCODER) += fate-api-movtext
 fate-api-movtext: $(APITESTSDIR)/api-movtext-test$(EXESUF)
 fate-api-movtext: CMD = run $(APITESTSDIR)/api-movtext-test$(EXESUF)
diff --git a/tests/ref/fate/api-sample-rate-adpcm_vima 
b/tests/ref/fate/api-sample-rate-adpcm_vima
new file mode 100644
index 00000000000..fa83be2f8be
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-adpcm_vima
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 16 samples
diff --git a/tests/ref/fate/api-sample-rate-bmv_audio 
b/tests/ref/fate/api-sample-rate-bmv_audio
new file mode 100644
index 00000000000..af167c7ad5e
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-bmv_audio
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 32 samples
diff --git a/tests/ref/fate/api-sample-rate-imc 
b/tests/ref/fate/api-sample-rate-imc
new file mode 100644
index 00000000000..2502f375244
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-imc
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 256 samples
diff --git a/tests/ref/fate/api-sample-rate-real_144 
b/tests/ref/fate/api-sample-rate-real_144
new file mode 100644
index 00000000000..f5800b357e9
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-real_144
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 160 samples
diff --git a/tests/ref/fate/api-sample-rate-real_288 
b/tests/ref/fate/api-sample-rate-real_288
new file mode 100644
index 00000000000..f5800b357e9
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-real_288
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 160 samples
diff --git a/tests/ref/fate/api-sample-rate-sbc 
b/tests/ref/fate/api-sample-rate-sbc
new file mode 100644
index 00000000000..bdbfd9ccf07
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-sbc
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 120 samples
diff --git a/tests/ref/fate/api-sample-rate-sipr 
b/tests/ref/fate/api-sample-rate-sipr
new file mode 100644
index 00000000000..f5800b357e9
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-sipr
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 160 samples
diff --git a/tests/ref/fate/api-sample-rate-siren 
b/tests/ref/fate/api-sample-rate-siren
new file mode 100644
index 00000000000..468af81a9d8
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-siren
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 320 samples
diff --git a/tests/ref/fate/api-sample-rate-ws_snd1 
b/tests/ref/fate/api-sample-rate-ws_snd1
new file mode 100644
index 00000000000..fa83be2f8be
--- /dev/null
+++ b/tests/ref/fate/api-sample-rate-ws_snd1
@@ -0,0 +1,2 @@
+sample rate    0: invalid data
+sample rate 8000: 16 samples
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to