Update openjpeg
[pdfium.git] / core / src / fxcodec / fx_libopenjpeg / libopenjpeg20 / function_list.c
index 4c8aae6..b9a8b4a 100644 (file)
 opj_procedure_list_t *  opj_procedure_list_create()
 {
         /* memory allocation */
-        opj_procedure_list_t * l_validation = (opj_procedure_list_t *) opj_malloc(sizeof(opj_procedure_list_t));
+        opj_procedure_list_t * l_validation = (opj_procedure_list_t *) opj_calloc(1,sizeof(opj_procedure_list_t));
         if (! l_validation)
         {
                 return 00;
         }
         /* initialization */
-        memset(l_validation,0,sizeof(opj_procedure_list_t));
         l_validation->m_nb_max_procedures = OPJ_VALIDATION_SIZE;
-        l_validation->m_procedures = (opj_procedure*)opj_malloc(
-                OPJ_VALIDATION_SIZE * sizeof(opj_procedure));
+        l_validation->m_procedures = (opj_procedure*)opj_calloc(OPJ_VALIDATION_SIZE, sizeof(opj_procedure));
         if (! l_validation->m_procedures)
         {
                 opj_free(l_validation);
                 return 00;
         }
-        memset(l_validation->m_procedures,0,OPJ_VALIDATION_SIZE * sizeof(opj_procedure));
         return l_validation;
 }