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] avcodec/lcldec: fix uncompressed buffer size calculation
@ 2023-09-30 10:36 Paul B Mahol
  2023-10-02 14:23 ` Paul B Mahol
  0 siblings, 1 reply; 5+ messages in thread
From: Paul B Mahol @ 2023-09-30 10:36 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

Attached.

[-- Attachment #2: 0001-avcodec-lcldec-fix-uncompressed-buffer-size-calculat.patch --]
[-- Type: text/x-patch, Size: 923 bytes --]

From efa34f7cd140f4e696641ce730b8e2b97e3d8452 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 30 Sep 2023 12:33:58 +0200
Subject: [PATCH] avcodec/lcldec: fix uncompressed buffer size calculation

The width is truncated to multiple of 2.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/lcldec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index 11e28683ba..3168f9697f 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -248,7 +248,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
                 bppx2 = 0; // will error out below
                 break;
             }
-            if (len < ((width * height * bppx2) >> 1))
+            if (len < (((width & 0xFFFFFFFC) * height * bppx2) >> 1))
                 return AVERROR_INVALIDDATA;
             break;
         }
-- 
2.42.0


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2023-10-03 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-30 10:36 [FFmpeg-devel] [PATCH] avcodec/lcldec: fix uncompressed buffer size calculation Paul B Mahol
2023-10-02 14:23 ` Paul B Mahol
2023-10-02 19:00   ` Michael Niedermayer
2023-10-02 19:42     ` Paul B Mahol
2023-10-03 13:55       ` Michael Niedermayer

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