Browse Source

codec_decode cleanup (#1661)

pull/292/head
qndel 7 years ago committed by Anders Jenbo
parent
commit
c629eb1e60
  1. 25
      Source/codec.cpp

25
Source/codec.cpp

@ -34,20 +34,21 @@ int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword)
memset(buf, 0, sizeof(buf));
sig = (CodecSignature *)pbSrcDst;
if (sig->error > 0) {
size = 0;
SHA1Clear();
} else {
SHA1Result(0, dst);
if (sig->checksum != *(DWORD *)dst) {
memset(dst, 0, sizeof(dst));
size = 0;
SHA1Clear();
} else {
size += sig->last_chunk_size - 64;
SHA1Clear();
}
goto error;
}
SHA1Result(0, dst);
if (sig->checksum != *(DWORD *)dst) {
memset(dst, 0, sizeof(dst));
goto error;
}
size += sig->last_chunk_size - 64;
SHA1Clear();
return size;
error:
SHA1Clear();
return 0;
}
void codec_init_key(int unused, char *pszPassword)

Loading…
Cancel
Save