[vlc-commits] access: dtv: fix realloc usage

Steve Lhomme git at videolan.org
Fri Apr 29 10:11:43 CEST 2016


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Apr 28 16:22:40 2016 +0200| [1d4445d8a1d6264fc9f20616ddd7834c1146cf24] | committer: Thomas Guillem

access: dtv: fix realloc usage

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/access/dtv/en50221_capmt.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/access/dtv/en50221_capmt.h b/modules/access/dtv/en50221_capmt.h
index 9b4878d..87b8eeb 100644
--- a/modules/access/dtv/en50221_capmt.h
+++ b/modules/access/dtv/en50221_capmt.h
@@ -56,11 +56,12 @@ static inline en50221_capmt_es_info_t *en50221_capmt_EsAdd( en50221_capmt_info_t
                                                             uint8_t i_stream_type,
                                                             uint16_t i_es_pid )
 {
-    en50221_capmt_es_info_t *p_realloc = realloc( p_en->p_es, p_en->i_es_count + 1 );
+    en50221_capmt_es_info_t *p_realloc = realloc( p_en->p_es, sizeof(en50221_capmt_es_info_t) *
+                                                              (p_en->i_es_count + 1) );
     if( likely(p_realloc) )
     {
         p_en->p_es = p_realloc;
-        en50221_capmt_es_info_t *p_es = &p_en->p_es[ p_en->i_es_count ];
+        en50221_capmt_es_info_t *p_es = &p_en->p_es[ p_en->i_es_count++ ];
         p_es->i_es_pid = i_es_pid;
         p_es->i_stream_type = i_stream_type;
         p_es->i_descriptors = 0;



More information about the vlc-commits mailing list