提交 4b50bd73 编写于 作者: S Stefan Hajnoczi 提交者: Michael Roth

dmg: use appropriate types when reading chunks

Use the right types instead of signed int:

  size_t new_size;

  This is a byte count for g_realloc() that is calculated from uint32_t
  and size_t values.

  uint32_t chunk_count;

  Use the same type as s->n_chunks, which is used together with
  chunk_count.

This patch is a cleanup and does not fix bugs.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NMax Reitz <mreitz@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit eb71803b)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 4ee5b9c8
......@@ -161,7 +161,8 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
}
if (type == 0x6d697368 && count >= 244) {
int new_size, chunk_count;
size_t new_size;
uint32_t chunk_count;
offset += 4;
offset += 200;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册