[vlc-commits] packetizer: mpegvideo: fix reading wrong color spaces

Francois Cartegnie git at videolan.org
Fri Feb 17 11:15:00 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 16 14:10:31 2017 +0100| [0d5cc81a26297bd5e58a4b0c2b9f9095f4cd34b2] | committer: Francois Cartegnie

packetizer: mpegvideo: fix reading wrong color spaces

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d5cc81a26297bd5e58a4b0c2b9f9095f4cd34b2
---

 modules/packetizer/mpegvideo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 660123e..128daa8 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -639,13 +639,13 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
             p_sys->i_repeat_first_field= (p_frag->p_buffer[7]>>1)&0x01;
             p_sys->i_progressive_frame = p_frag->p_buffer[8] >> 7;
         }
-        if( p_frag->i_buffer >= 10 )
+        else if( i_type == 0x02 && p_frag->i_buffer > 8 )
         {
             /* Sequence display extension */
             bool contains_color_description = (p_frag->p_buffer[4] & 0x01);
             //uint8_t video_format = (p_frag->p_buffer[4] & 0x0f) >> 1;
 
-            if( contains_color_description )
+            if( contains_color_description && p_frag->i_buffer > 11 )
             {
                 uint8_t color_primaries = p_frag->p_buffer[5];
                 uint8_t color_transfer  = p_frag->p_buffer[6];



More information about the vlc-commits mailing list