[vlc-commits] [Git][videolan/vlc][3.0.x] 5 commits: demux: avi: fix debug height for flipped planes (fix #22915)

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Dec 25 15:42:45 UTC 2022



Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC


Commits:
912a396a by Francois Cartegnie at 2022-12-23T18:12:16+01:00
demux: avi: fix debug height for flipped planes (fix #22915)

(cherry picked from commit 136fd86090b11ba6d89e46e16e8f7474d4451e2f)

- - - - -
2d789162 by Francois Cartegnie at 2022-12-23T18:30:36+01:00
demux: avi: fix conversion

(cherry picked from commit 52ce937c7faf4c348f740157b2ed880cd79b680a)

- - - - -
76b0bb36 by Francois Cartegnie at 2022-12-23T18:35:15+01:00
demux: avi: int_max is flipped range

(cherry picked from commit 0d2b0a46700b9aa363d0d76e508c63e17420996e)

- - - - -
4c17c930 by Francois Cartegnie at 2022-12-23T18:35:52+01:00
demux: avi: add more comments

(cherry picked from commit 5be2d51811ed48c596069a7799199b9a99af7729)

- - - - -
2def5869 by Francois Cartegnie at 2022-12-23T18:35:54+01:00
demux: avi: fix playback of flipped rgb (refs #22915)

(cherry picked from commit 99a193f6d9639220e5bcebb23585d7e26651a2c4)

- - - - -


2 changed files:

- modules/demux/avi/avi.c
- modules/demux/avi/libavi.c


Changes:

=====================================
modules/demux/avi/avi.c
=====================================
@@ -690,8 +690,12 @@ static int Open( vlc_object_t * p_this )
                     }
 
                     tk->i_width_bytes = p_bih->biWidth * (p_bih->biBitCount >> 3);
-                    /* RGB DIB are coded from bottom to top */
-                    if ( p_bih->biHeight < INT32_MAX ) tk->b_flipped = true;
+                    /* Unintuitively RGB DIB are always coded from bottom to top,
+                     * except when height is negative */
+                    if ( p_bih->biHeight <= INT32_MAX )
+                        tk->b_flipped = true;
+                    /* else
+                     *     set below to positive value */
                 }
                 else
                 {
@@ -722,8 +726,10 @@ static int Open( vlc_object_t * p_this )
 
                  /* Uncompresse Bitmap or YUV, YUV being always topdown */
                 if ( tk->fmt.video.i_height > INT32_MAX )
-                    tk->fmt.video.i_height =
-                        (unsigned int)(-(int)p_bih->biHeight);
+                {
+                    tk->fmt.video.i_visible_height =
+                    tk->fmt.video.i_height = -1 * p_bih->biHeight;
+                }
 
                 avi_chunk_vprp_t *p_vprp = AVI_ChunkFind( p_strl, AVIFOURCC_vprp, 0, false );
                 if( p_vprp )
@@ -757,8 +763,9 @@ static int Open( vlc_object_t * p_this )
 
                 msg_Dbg( p_demux, "stream[%u] video(%4.4s) %"PRIu32"x%"PRIu32" %dbpp %ffps",
                          i, (char*)&p_bih->biCompression,
-                         (uint32_t)p_bih->biWidth,
-                         (uint32_t)p_bih->biHeight,
+                         p_bih->biWidth,
+                         (p_bih->biHeight <= INT_MAX) ? p_bih->biHeight
+                                                      : -1 * p_bih->biHeight,
                          p_bih->biBitCount,
                          (float)tk->i_rate/(float)tk->i_scale );
 


=====================================
modules/demux/avi/libavi.c
=====================================
@@ -539,8 +539,9 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
             msg_Dbg( (vlc_object_t*)s,
                      "strf: video:%4.4s %"PRIu32"x%"PRIu32" planes:%d %dbpp",
                      (char*)&p_bih->biCompression,
-                     (uint32_t)p_bih->biWidth,
-                     (uint32_t)p_bih->biHeight,
+                     p_bih->biWidth,
+                     p_bih->biHeight <= INT32_MAX ? p_bih->biHeight
+                                                  : -1 * p_bih->biHeight,
                      p_bih->biPlanes,
                      p_bih->biBitCount );
 #endif



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6183d1e1530e5fee926a4fbbae8fe8628a2bcd57...2def5869420bce69449f45ae5206122899a8f2ca

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6183d1e1530e5fee926a4fbbae8fe8628a2bcd57...2def5869420bce69449f45ae5206122899a8f2ca
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list