summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--block/dmg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/dmg.c b/block/dmg.c
index d5c1a687e4..02a3d67206 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -239,7 +239,8 @@ static inline int dmg_read_chunk(BDRVDMGState *s,int sector_num)
 		return -1;
 	    break; }
 	case 1: /* copy */
-	    ret = read(s->fd, s->uncompressed_chunk, s->lengths[chunk]);
+	    ret = pread(s->fd, s->uncompressed_chunk, s->lengths[chunk],
+                        s->offsets[chunk]);
 	    if (ret != s->lengths[chunk])
 		return -1;
 	    break;