[FFmpeg-devel] [PATCH 1/3] avformat/wady: Check >0 samplerate and channels 1 || 2.

Michael Niedermayer michael at niedermayer.cc
Wed Mar 20 04:19:24 EET 2024


The WADY decoder only supports mono and stereo

This fixes a probetest failure

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/wady.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/wady.c b/libavformat/wady.c
index 6dcc0018f3..81a64c6d3f 100644
--- a/libavformat/wady.c
+++ b/libavformat/wady.c
@@ -32,7 +32,8 @@ static int wady_probe(const AVProbeData *p)
         return 0;
     if (p->buf[4] != 0 || p->buf[5] == 0 ||
         AV_RL16(p->buf+6) == 0 ||
-        AV_RL32(p->buf+8) == 0)
+        AV_RL16(p->buf+6) > 2 ||
+        (int32_t)AV_RL32(p->buf+8) <= 0)
         return 0;
 
     return AVPROBE_SCORE_MAX / 3 * 2;
-- 
2.17.1



More information about the ffmpeg-devel mailing list