diff mbox series

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

Message ID 20240320021926.3759-1-michael@niedermayer.cc
State Accepted
Commit 6f9e90ab0bede36cc960a099e8f19998345e7164
Headers show
Series [FFmpeg-devel,1/3] avformat/wady: Check >0 samplerate and channels 1 || 2. | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer March 20, 2024, 2:19 a.m. UTC
The WADY decoder only supports mono and stereo

This fixes a probetest failure

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

Comments

Michael Niedermayer March 25, 2024, 5:17 p.m. UTC | #1
On Wed, Mar 20, 2024 at 03:19:24AM +0100, Michael Niedermayer wrote:
> The WADY decoder only supports mono and stereo
> 
> This fixes a probetest failure
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/wady.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply patch 1 and 2

[...]
diff mbox series

Patch

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;