AcessViolation em while ao gerar MD5

Delphi

28/05/2014

// Update given Context to include Length bytes of Input
procedure MD5Update(var Context: MD5Context; Input: pChar; Length: longword);
var
   Index: longword;
   PartLen: longword;
   I: longword;
begin
   with Context do begin
      Index := (Count[0] shr 3) and $3f;
      inc(Count[0], Length shl 3);
      if Count[0] < (Length shl 3) then inc(Count[1]);
      inc(Count[1], Length shr 29);
   end;
   PartLen := 64 - Index;
   if Length >= PartLen then begin
      CopyMemory(@Context.Buffer[Index], Input, PartLen);
      Transform(@Context.Buffer, Context.State);

      I := PartLen;
      while I + 63 < Length do begin
         Transform(@Input[I], Context.State);
         inc(I, 64);
      end;
      Index := 0;
   end else I := 0;
   CopyMemory(@Context.Buffer[Index], @Input[I], Length - I);
end;


Bom, o meu problema é o seguinte: estou migrando do delphi7 para o xe5, no delphi7 esta fazendo esta procedure direitinho, porem no xe5 está dando acess violation em algum momento do while, eu queria saber se alguém passo por esse mesmo problema ou sabe me dizer o motivo.
obs: o valor Lenght desse while estava 50010066

Grato desde Já!
Nathan Boneti

Nathan Boneti

Curtidas 0
POSTAR