diff mbox series

[FFmpeg-devel,10/22] avformat/nsvdec: Check asize for PCM

Message ID 20240711233417.1896879-10-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/22] avformat/asfdec_o: Check size of index object | expand

Checks

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

Commit Message

Michael Niedermayer July 11, 2024, 11:34 p.m. UTC
Fixes: CID1604527 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/nsvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 3b8f812aa5e..dd01765d7d2 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -617,7 +617,7 @@  null_chunk_retry:
         pkt = &nsv->ahead[NSV_ST_AUDIO];
         /* read raw audio specific header on the first audio chunk... */
         /* on ALL audio chunks ?? seems so! */
-        if (asize && st[NSV_ST_AUDIO]->codecpar->codec_tag == MKTAG('P', 'C', 'M', ' ')/* && fill_header*/) {
+        if (asize >= 4 && st[NSV_ST_AUDIO]->codecpar->codec_tag == MKTAG('P', 'C', 'M', ' ')/* && fill_header*/) {
             uint8_t bps;
             uint8_t channels;
             uint16_t samplerate;