@@ -248,8 +248,6 @@ FIMULTIBITMAP* OpenMultiBitmapImpl(FREE_IMAGE_FORMAT fif, std::filesystem::path
248248
249249 // store the MULTIBITMAPHEADER in the surrounding FIMULTIBITMAP structure
250250
251- bitmap->data = header.get ();
252-
253251 if (header->handle ) {
254252 // open persistent data is supported
255253 if (node->SupportsOpenPersistent ()) {
@@ -287,7 +285,7 @@ FIMULTIBITMAP* OpenMultiBitmapImpl(FREE_IMAGE_FORMAT fif, std::filesystem::path
287285 }
288286 // return the multibitmap
289287 // std::bad_alloc won't be thrown from here on
290- header.release (); // now owned by bitmap
288+ bitmap-> data = header.release (); // now owned by bitmap
291289 return bitmap.release (); // now owned by caller
292290 }
293291 }
@@ -344,8 +342,6 @@ FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_h
344342
345343 // store the MULTIBITMAPHEADER in the surrounding FIMULTIBITMAP structure
346344
347- bitmap->data = header.get ();
348-
349345 // open persistent data is supported
350346 if (node->SupportsOpenPersistent ()) {
351347 header->persistent_data = node->OpenPersistent (&header->io , header->handle , header->read_only );
@@ -362,7 +358,7 @@ FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_h
362358
363359 // no need to open cache - it is in-memory by default
364360
365- header.release ();
361+ bitmap-> data = header.release ();
366362 return bitmap.release ();
367363 }
368364 }
0 commit comments