Fix a 10L bug in the memory stream reader.
authorTimothy B. Terriberry <tterribe@xiph.org>
Tue, 2 Oct 2012 14:58:06 +0000 (07:58 -0700)
committerTimothy B. Terriberry <tterribe@xiph.org>
Tue, 2 Oct 2012 14:58:06 +0000 (07:58 -0700)
It's helpful if we don't always read from the start of the array.
Thanks to Matti Virolainen for the report.

src/stream.c

index 0de7a79..e88e77a 100644 (file)
@@ -105,7 +105,7 @@ static size_t op_mem_read(void *_ptr,size_t _size,size_t _nmemb,void *_stream){
     _nmemb=(size-pos)/_size;
     total=_size*_nmemb;
   }
-  memcpy(_ptr,stream->data,total);
+  memcpy(_ptr,stream->data+pos,total);
   pos+=total;
   stream->pos=pos;
   return _nmemb;