fixed ERROR_GENERIC on dstSize_tooSmall

required by users which depends on this error code to size dest buffer
This commit is contained in:
Yann Collet
2017-03-23 17:59:50 -07:00
parent 5caaa15968
commit 23776ce290
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ static size_t FSE_writeNCount_generic (void* header, size_t headerBufferSize,
size_t FSE_writeNCount (void* buffer, size_t bufferSize, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
{
if (tableLog > FSE_MAX_TABLELOG) return ERROR(GENERIC); /* Unsupported */
if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported */
if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported */
if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog))