[vlc-commits] packetizer: mpeg4video: use defines for VOL lookup

Francois Cartegnie git at videolan.org
Wed Jan 13 16:57:14 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 13 13:22:23 2021 +0100| [cd19ffa8c36b7a8bf741e35f7b753e597ba9d2b7] | committer: Francois Cartegnie

packetizer: mpeg4video: use defines for VOL lookup

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

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

diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
index 85ad7e9165..46b2e7c706 100644
--- a/modules/packetizer/mpeg4video.c
+++ b/modules/packetizer/mpeg4video.c
@@ -372,8 +372,10 @@ static int ParseVOL( decoder_t *p_dec, es_format_t *fmt,
         if( i_vol <= 5 )
             return VLC_EGENERIC;
 
-        if( p_vol[0] == 0x00 && p_vol[1] == 0x00 && p_vol[2] == 0x01 &&
-            p_vol[3] >= 0x20 && p_vol[3] <= 0x2f ) break;
+        uint32_t i_startcode = GetDWBE( p_vol );
+        if( i_startcode >= VIDEO_OBJECT_LAYER_START_CODE &&
+            i_startcode < RESERVED_START_CODE )
+            break;
 
         p_vol++; i_vol--;
     }



More information about the vlc-commits mailing list