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/5] avcodec/flacdec: Fix overflow in "33bit" decorrelate
@ 2023-09-20  0:30 Michael Niedermayer
  2023-09-20  0:30 ` [FFmpeg-devel] [PATCH 2/5] avcodec/flacdec: Fix integer overflow in "33bit" DECODER_SUBFRAME_FIXED_WIDE() Michael Niedermayer
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Michael Niedermayer @ 2023-09-20  0:30 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: signed integer overflow: 538976288 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-6275845531238400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/flacdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 524a0469495..0569f019b3a 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -706,10 +706,10 @@ static void decorrelate_33bps(int ch_mode, int32_t **decoded, int64_t *decoded_3
     int i;
     if (ch_mode == FLAC_CHMODE_LEFT_SIDE ) {
         for (i = 0; i < len; i++)
-           decoded[1][i] = decoded[0][i] - decoded_33bps[i];
+           decoded[1][i] = decoded[0][i] - (uint64_t)decoded_33bps[i];
     } else if (ch_mode == FLAC_CHMODE_RIGHT_SIDE ) {
         for (i = 0; i < len; i++)
-           decoded[0][i] = decoded[1][i] + decoded_33bps[i];
+           decoded[0][i] = decoded[1][i] + (uint64_t)decoded_33bps[i];
     } else if (ch_mode == FLAC_CHMODE_MID_SIDE ) {
         for (i = 0; i < len; i++) {
             uint64_t a = decoded[0][i];
-- 
2.17.1

_______________________________________________
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:[~2023-10-03 14:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20  0:30 [FFmpeg-devel] [PATCH 1/5] avcodec/flacdec: Fix overflow in "33bit" decorrelate Michael Niedermayer
2023-09-20  0:30 ` [FFmpeg-devel] [PATCH 2/5] avcodec/flacdec: Fix integer overflow in "33bit" DECODER_SUBFRAME_FIXED_WIDE() Michael Niedermayer
2023-09-20  0:30 ` [FFmpeg-devel] [PATCH 3/5] avcodec/utvideodec: move allocation to the end of init Michael Niedermayer
2023-09-20  0:30 ` [FFmpeg-devel] [PATCH 4/5] avcodec/vlc: free multi on fail Michael Niedermayer
2023-09-26  9:36   ` Paul B Mahol
2023-09-20  0:30 ` [FFmpeg-devel] [PATCH 5/5] avformat/avs: Check if return code is representable Michael Niedermayer
2023-10-03 14:26 ` [FFmpeg-devel] [PATCH 1/5] avcodec/flacdec: Fix overflow in "33bit" decorrelate 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