]> granicus.if.org Git - taglib/commitdiff
Stop calculating the offset in RIFF::File::chunkData().
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Sun, 24 May 2015 15:43:36 +0000 (00:43 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Sun, 24 May 2015 15:43:36 +0000 (00:43 +0900)
taglib/riff/rifffile.cpp

index 979ec530c18dd4e0949cd6a22a0147467cec91af..efd4f642636af456c2f36e5c099d478e0bccbbc1 100644 (file)
@@ -127,15 +127,7 @@ ByteVector RIFF::File::chunkData(uint i)
   if(i >= chunkCount())
     return ByteVector::null;
 
-  // Offset for the first subchunk's data
-
-  long begin = 12 + 8;
-
-  for(uint it = 0; it < i; it++)
-    begin += 8 + d->chunks[it].size + d->chunks[it].padding;
-
-  seek(begin);
-
+  seek(d->chunks[i].offset);
   return readBlock(d->chunks[i].size);
 }