Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  ots-lz4.patch   Sprache: unbekannt

 
Spracherkennung für: .patch vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

diff --git a/src/glat.cc b/src/glat.cc
--- a/src/glat.cc
+++ b/src/glat.cc
@@ -5,7 +5,7 @@
 #include "glat.h"
 
 #include "gloc.h"
-#include "lz4.h"
+#include "mozilla/Compression.h"
 #include <list>
 #include <memory>

@@ -217,14 +217,15 @@ bool OpenTypeGLAT_v3::Parse(const uint8_t* data, size_t length,
                             decompressed_size / (1024.0 * 1024.0));
       }
       std::unique_ptr<uint8_t> decompressed(new uint8_t[decompressed_size]());
-      int ret = LZ4_decompress_safe_partial(
+      size_t outputSize = 0;
+      bool ret = mozilla::Compression::LZ4::decompressPartial(
           reinterpret_cast<const char*>(data + table.offset()),
-          reinterpret_cast<char*>(decompressed.get()),
           table.remaining(),  // input buffer size (input size + padding)
+          reinterpret_cast<char*>(decompressed.get()),
           decompressed_size,  // target output size
-          decompressed_size);  // output buffer size
-      if (ret < 0 || unsigned(ret) != decompressed_size) {
-        return DropGraphite("Decompression failed with error code %d", ret);
+          &outputSize);  // output buffer size
+      if (!ret || outputSize != decompressed_size) {
+        return DropGraphite("Decompression failed");
       }
       return this->Parse(decompressed.get(), decompressed_size, true);
 
diff --git a/src/silf.cc b/src/silf.cc
--- a/src/silf.cc
+++ b/src/silf.cc
@@ -1,16 +1,16 @@
 // Copyright (c) 2009-2017 The OTS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #include "silf.h"
 
 #include "name.h"
-#include "lz4.h"
+#include "mozilla/Compression.h"
 #include <cmath>
 #include <memory>
 
 namespace ots {
 
 bool OpenTypeSILF::Parse(const uint8_t* data, size_t length,
                          bool prevent_decompression) {
   Buffer table(data, length);
@@ -45,24 +45,25 @@ bool OpenTypeSILF::Parse(const uint8_t*
         }
         // decompressed table must be <= OTS_MAX_DECOMPRESSED_TABLE_SIZE
         if (decompressed_size > OTS_MAX_DECOMPRESSED_TABLE_SIZE) {
           return DropGraphite("Decompressed size exceeds %gMB: %gMB",
                               OTS_MAX_DECOMPRESSED_TABLE_SIZE / (1024.0 * 1024.0),
                               decompressed_size / (1024.0 * 1024.0));
         }
         std::unique_ptr<uint8_t[]> decompressed(new uint8_t[decompressed_size]());
-        int ret = LZ4_decompress_safe_partial(
+        size_t outputSize = 0;
+        bool ret = mozilla::Compression::LZ4::decompressPartial(
             reinterpret_cast<const char*>(data + table.offset()),
-            reinterpret_cast<char*>(decompressed.get()),
             table.remaining(),  // input buffer size (input size + padding)
+            reinterpret_cast<char*>(decompressed.get()),
             decompressed_size,  // target output size
-            decompressed_size);  // output buffer size
-        if (ret < 0 || unsigned(ret) != decompressed_size) {
-          return DropGraphite("Decompression failed with error code %d", ret);
+            &outputSize);  // output buffer size
+        if (!ret || outputSize != decompressed_size) {
+          return DropGraphite("Decompression failed");
         }
         return this->Parse(decompressed.get(), decompressed_size, true);
       }
       default:
         return DropGraphite("Unknown compression scheme");
     }
   }
   if (!table.ReadU16(&this->numSub)) { 

[Dauer der Verarbeitung: 0.38 Sekunden]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=738142