Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] avcodec/liblc3dec: sanitize channel count in avctx
@ 2024-04-04 16:29 James Almer
  2024-04-04 16:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/liblc3enc: don't force unspec channel layouts James Almer
  2024-04-04 16:40 ` [FFmpeg-devel] [PATCH 1/2] avcodec/liblc3dec: sanitize channel count in avctx Stefano Sabatini
  0 siblings, 2 replies; 7+ messages in thread
From: James Almer @ 2024-04-04 16:29 UTC (permalink / raw)
  To: ffmpeg-devel

Should prevent out of array accesses.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/liblc3dec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/liblc3dec.c b/libavcodec/liblc3dec.c
index c0a31bc91f..52364859d4 100644
--- a/libavcodec/liblc3dec.c
+++ b/libavcodec/liblc3dec.c
@@ -46,6 +46,8 @@ static av_cold int liblc3_decode_init(AVCodecContext *avctx)
 
     if (avctx->extradata_size < 10)
         return AVERROR_INVALIDDATA;
+    if (channels < 0 || channels > DECODER_MAX_CHANNELS)
+        return AVERROR_INVALIDDATA;
 
     liblc3->frame_us = AV_RL16(avctx->extradata + 0) * 10;
     liblc3->srate_hz = avctx->sample_rate;
-- 
2.44.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-04 17:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-04 16:29 [FFmpeg-devel] [PATCH 1/2] avcodec/liblc3dec: sanitize channel count in avctx James Almer
2024-04-04 16:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/liblc3enc: don't force unspec channel layouts James Almer
2024-04-04 16:45   ` Stefano Sabatini
2024-04-04 16:53     ` James Almer
2024-04-04 16:59   ` Andreas Rheinhardt
2024-04-04 17:02     ` Stefano Sabatini
2024-04-04 16:40 ` [FFmpeg-devel] [PATCH 1/2] avcodec/liblc3dec: sanitize channel count in avctx Stefano Sabatini

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git