[libdvbpsi-devel] dr_81: revert previous patch, use calloc instead

Michael Krufky git at videolan.org
Wed Feb 5 09:18:26 CET 2014


libdvbpsi | branch: master | Michael Krufky <mkrufky at linuxtv.org> | Tue Feb  4 22:09:50 2014 -0500| [4272bb9f0d27fddef19e3600d917a888067dd32c] | committer: Michael Krufky

dr_81: revert previous patch, use calloc instead

Signed-off-by: Michael Krufky <mkrufky at linuxtv.org>

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=4272bb9f0d27fddef19e3600d917a888067dd32c
---

 src/descriptors/dr_81.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/descriptors/dr_81.c b/src/descriptors/dr_81.c
index 31a7e77..263a483 100644
--- a/src/descriptors/dr_81.c
+++ b/src/descriptors/dr_81.c
@@ -59,12 +59,10 @@ dvbpsi_ac3_audio_dr_t *dvbpsi_DecodeAc3AudioDr(dvbpsi_descriptor_t *p_descriptor
     if (p_descriptor->i_length < 3)
         return NULL;
 
-    p_decoded = (dvbpsi_ac3_audio_dr_t*)malloc(sizeof(dvbpsi_ac3_audio_dr_t));
+    p_decoded = (dvbpsi_ac3_audio_dr_t*)calloc(1, sizeof(dvbpsi_ac3_audio_dr_t));
     if (!p_decoded)
         return NULL;
 
-    memset(p_decoded, 0, sizeof (dvbpsi_ac3_audio_dr_t));
-
     p_descriptor->p_decoded = (void*)p_decoded;
 
     p_decoded->i_sample_rate_code = 0x07 & (buf[0] >> 5);



More information about the libdvbpsi-devel mailing list