Fix deadlock.
[dcpomatic.git] / src / lib / image_examiner.cc
index 6212875b1de0ed6f3b063e0f67acfa7e6338c613..1fd9cd554a6880140ef0caa0bcab081a93f56ff4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
 #include "exceptions.h"
 #include "config.h"
 #include "cross.h"
-#include <dcp/xyz_frame.h>
 #include <dcp/exceptions.h>
+#include <dcp/xyz_image.h>
 #include <Magick++.h>
 #include <iostream>
 
@@ -47,11 +47,11 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
        boost::filesystem::path path = content->path(0).string ();
        if (valid_j2k_file (path)) {
                boost::uintmax_t size = boost::filesystem::file_size (path);
-               uint8_t* buffer = new uint8_t[size];
                FILE* f = fopen_boost (path, "r");
                if (!f) {
                        throw FileError ("Could not open file for reading", path);
                }
+               uint8_t* buffer = new uint8_t[size];
                fread (buffer, 1, size, f);
                fclose (f);
                try {