From: Nick Terrell Date: Wed, 17 Apr 2019 18:34:52 +0000 (-0700) Subject: [legacy] Return the right error code X-Git-Tag: v1.4.1^2~53^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5922f4e2ae8829f54c5ac842a1b43e8f11dbf3af;p=thirdparty%2Fzstd.git [legacy] Return the right error code --- diff --git a/lib/legacy/zstd_legacy.h b/lib/legacy/zstd_legacy.h index 27f887024..0dbd3c7a4 100644 --- a/lib/legacy/zstd_legacy.h +++ b/lib/legacy/zstd_legacy.h @@ -238,7 +238,7 @@ MEM_STATIC ZSTD_frameSizeInfo ZSTD_findFrameSizeInfoLegacy(const void *src, size frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR; break; } - if (frameSizeInfo.compressedSize > srcSize) { + if (!ZSTD_isError(frameSizeInfo.compressedSize) && frameSizeInfo.compressedSize > srcSize) { frameSizeInfo.compressedSize = ERROR(srcSize_wrong); frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR; }