[FFmpeg-cvslog] avformat/nsvdec: Check asize for PCM

Michael Niedermayer git at videolan.org
Wed Jul 24 17:50:51 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 11 20:29:10 2024 +0200| [a1524dbc936493aaecf1a616c7087584e3900e15] | committer: Michael Niedermayer

avformat/nsvdec: Check asize for PCM

Fixes: CID1604527 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e83e24650489e63f6b31e8c72a973db6367947b9)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1524dbc936493aaecf1a616c7087584e3900e15
---

 libavformat/nsvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index eb26b29450..d57a644c67 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -603,7 +603,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;



More information about the ffmpeg-cvslog mailing list