diff --git a/bochs/iodev/devices.cc b/bochs/iodev/devices.cc
index 664d9dbb7..9411c2adb 100644
--- a/bochs/iodev/devices.cc
+++ b/bochs/iodev/devices.cc
@@ -1210,7 +1210,7 @@ void bx_pci_device_stub_c::load_pci_rom(const char *path)
     return;
   }
 
-  max_size = 0x10000;
+  max_size = 0x20000;
   size = (unsigned long)stat_buf.st_size;
   if (size > max_size) {
     close(fd);
@@ -1226,6 +1226,7 @@ void bx_pci_device_stub_c::load_pci_rom(const char *path)
     max_size >>= 1;
   }
   pci_rom_size = (max_size << 1);
+  pci_rom = new Bit8u[pci_rom_size];
 
   while (size > 0) {
     ret = read(fd, (bx_ptr_t) pci_rom, size);
diff --git a/bochs/iodev/iodev.h b/bochs/iodev/iodev.h
index 9ffff7dc7..60ce5f0d1 100644
--- a/bochs/iodev/iodev.h
+++ b/bochs/iodev/iodev.h
@@ -86,7 +86,10 @@ class device_image_t;
 // but it make serious problems for cirrus_svga device
 class BOCHSAPI bx_pci_device_stub_c {
 public:
-  virtual ~bx_pci_device_stub_c() {}
+  bx_pci_device_stub_c(): pci_rom(NULL), pci_rom_size(0) {}
+  virtual ~bx_pci_device_stub_c() {
+    if (pci_rom != NULL) delete [] pci_rom;
+  }
 
   virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len) {
     return 0;
@@ -101,7 +104,7 @@ public:
 protected:
   Bit8u pci_conf[256];
   Bit32u pci_base_address[6];
-  Bit8u  pci_rom[65536];
+  Bit8u  *pci_rom;
   Bit32u pci_rom_address;
   Bit32u pci_rom_size;
 };