~ubuntu-branches/ubuntu/vivid/unrar-nonfree/vivid

« back to all changes in this revision

Viewing changes to unpack50mt.cpp

  • Committer: Package Import Robot
  • Author(s): Martin Meredith
  • Date: 2015-02-03 12:58:01 UTC
  • mfrom: (1.1.18) (5.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20150203125801-od6ev8cqy1er51vz
Tags: 1:5.2.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
  bool Done=false;
81
81
  while (!Done)
82
82
  {
 
83
    // Data amount, which is guaranteed to fit block header and tables,
 
84
    // so we can safely read them without additional checks.
 
85
    const int TooSmallToProcess=1024;
 
86
 
83
87
    int ReadSize=UnpIO->UnpRead(ReadBufMT+DataSize,(UNP_READ_SIZE_MT-DataSize)&~0xf);
84
88
    if (ReadSize<0)
85
89
      break;
86
90
    DataSize+=ReadSize;
87
91
    if (DataSize==0)
88
92
      break;
 
93
    if (ReadSize>0 && DataSize<TooSmallToProcess)
 
94
      continue;
89
95
 
90
96
    bool BufferProcessed=false;
91
97
    while (BlockStart<DataSize && !Done)
92
98
    {
93
 
      // Data amount, which is guaranteed to fit block header and tables,
94
 
      // so we can safely read them without additional checks.
95
 
      const int TooSmallToProcess=1024;
96
 
 
97
99
      uint BlockNumber=0,BlockNumberMT=0;
98
100
      while (BlockNumber<MaxUserThreads*UNP_BLOCKS_PER_THREAD)
99
101
      {
415
417
      CurItem->Length=Filter.Channels;
416
418
      CurItem->Distance=Filter.BlockLength;
417
419
 
418
 
      CurItem=D.Decoded+D.DecodedSize++;
419
 
 
420
 
      CurItem->Type=UNPDT_FILTER;
421
 
      CurItem->Length=Filter.PosR;
422
 
      CurItem->Distance=Filter.Width;
423
 
 
424
420
      continue;
425
421
    }
426
422
    if (MainSlot==257)
457
453
 
458
454
    if (Item->Type==UNPDT_LITERAL)
459
455
    {
460
 
#if defined(LITTLE_ENDIAN) && defined(PRESENT_INT32) && defined(ALLOW_NOT_ALIGNED_INT)
 
456
#if defined(LITTLE_ENDIAN) && defined(PRESENT_INT32) && defined(ALLOW_MISALIGNED)
461
457
      if (Item->Length==3 && UnpPtr<MaxWinSize-4)
462
458
      {
463
459
        *(uint32 *)(Window+UnpPtr)=*(uint32 *)Item->Literal;
504
500
              Filter.Channels=(byte)Item->Length;
505
501
              Filter.BlockLength=Item->Distance;
506
502
 
507
 
              Item++;
508
 
 
509
 
              Filter.PosR=(byte)Item->Length;
510
 
              Filter.Width=Item->Distance;
511
 
 
512
503
              AddFilter(Filter);
513
504
            }
514
505
    Item++;