[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: rawdv: bail if block_Alloc failed

Tristan Matthews (@tmatth) gitlab at videolan.org
Thu Dec 19 05:11:57 UTC 2024



Tristan Matthews pushed to branch master at VideoLAN / VLC


Commits:
fe5d8b37 by Tristan Matthews at 2024-12-19T04:50:07+00:00
demux: rawdv: bail if block_Alloc failed

- - - - -
63fb1e61 by Tristan Matthews at 2024-12-19T04:50:07+00:00
demux: ty: bail if block_Alloc failed

- - - - -


2 changed files:

- modules/demux/rawdv.h
- modules/demux/ty.c


Changes:

=====================================
modules/demux/rawdv.h
=====================================
@@ -139,6 +139,8 @@ static inline block_t *dv_extract_audio( block_t *p_frame_block )
     i_samples = dv_get_audio_sample_count( &p_buf[1], i_dsf );
 
     p_block = block_Alloc( 4 * i_samples );
+    if( unlikely( p_block == NULL ) )
+        return NULL;
 
     /* for each DIF segment */
     p_frame = p_frame_block->p_buffer;


=====================================
modules/demux/ty.c
=====================================
@@ -460,7 +460,9 @@ static int Demux( demux_t *p_demux )
     switch( p_rec->rec_type )
     {
         case 0xe0: /* video */
-            DemuxRecVideo( p_demux, p_rec, p_block_in );
+            if( DemuxRecVideo( p_demux, p_rec, p_block_in ) )
+                return VLC_DEMUXER_EGENERIC;
+
             break;
 
         case 0xc0: /* audio */
@@ -787,6 +789,12 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
             if( p_sys->p_cc[i] )
             {
                 block_t *p_cc = block_Alloc( p_sys->cc.i_data );
+                if( unlikely(p_cc == NULL) )
+                {
+                    block_Release(p_block_in);
+                    return -1;
+                }
+
                 p_cc->i_flags |= BLOCK_FLAG_TYPE_I;
                 p_cc->i_pts = p_block_in->i_pts;
                 memcpy( p_cc->p_buffer, p_sys->cc.p_data, p_sys->cc.i_data );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b4ff9a8c7c6dd084047a122926b9ee995860cd6d...63fb1e61327bd5580f89b6481a294ce5f1bbbfc9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b4ff9a8c7c6dd084047a122926b9ee995860cd6d...63fb1e61327bd5580f89b6481a294ce5f1bbbfc9
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