File: 0005-demux-avi-do-not-set-up-invalid-bitsperpixel.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (25 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: =?utf-8?q?Fran=C3=A7ois_Cartegnie?= <fcvlcdev@free.fr>
Date: Tue, 11 Jun 2024 17:26:11 +0700
Subject: demux: avi: do not set up invalid bitsperpixel

UINT16_MAX is set and propagated from the bitmap header reader

refs #28661
---
 modules/demux/avi/avi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 4a8296d..7059ca9 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -737,7 +737,8 @@ static int Open( vlc_object_t * p_this )
                 tk->fmt.video.i_width  = p_bih->biWidth;
                 tk->fmt.video.i_visible_height =
                 tk->fmt.video.i_height = p_bih->biHeight;
-                tk->fmt.video.i_bits_per_pixel = p_bih->biBitCount;
+                if( p_bih->biBitCount <= 32 )
+                    tk->fmt.video.i_bits_per_pixel = p_bih->biBitCount;
                 tk->fmt.video.i_frame_rate = tk->i_rate;
                 tk->fmt.video.i_frame_rate_base = tk->i_scale;