demux: avi: do not set up invalid bitsperpixel
authorFrançois Cartegnie <fcvlcdev@free.fr>
Tue, 11 Jun 2024 10:26:11 +0000 (17:26 +0700)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 14 Jan 2025 22:09:47 +0000 (23:09 +0100)
UINT16_MAX is set and propagated from the bitmap header reader

refs #28661

Gbp-Pq: Name 0005-demux-avi-do-not-set-up-invalid-bitsperpixel.patch

modules/demux/avi/avi.c

index 4a8296d8ffe93edec901f340ac73e1ffbfc61c46..7059ca96f22c64723b39eb952032c40a2726b602 100644 (file)
@@ -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;