Add new comment

Actual LibRaw already

Actual LibRaw already contains this check and additional loop count check

  memset (jh, 0, sizeof *jh);
  jh->restart = INT_MAX;
  fread (data, 2, 1, ifp);
  if (data[1] != 0xd8) return 0;
  do {
this line ==>     if(feof(ifp)) return 0;
and this line ==>    if(cnt++ > 1024) return 0; // 1024 tags limit

-- Alex Tutubalin @LibRaw LLC