@@ -104,7 +104,7 @@ class DPXOutput final : public ImageOutput {
104104
105105 // / Helper function - set keycode values from int array
106106 // /
107- void set_keycode_values (int * array);
107+ void set_keycode_values (cspan< int > array);
108108};
109109
110110
@@ -370,8 +370,7 @@ DPXOutput::open(const std::string& name, const ImageSpec& userspec,
370370
371371 ParamValue* kc = spec0.find_attribute (" smpte:KeyCode" , TypeKeyCode, false );
372372 if (kc) {
373- int * array = (int *)kc->data ();
374- set_keycode_values (array);
373+ set_keycode_values (cspan<int >((int *)kc->data (), 7 ));
375374
376375 // See if there is an overloaded dpx:Format
377376 std::string format = spec0.get_string_attribute (" dpx:Format" , " " );
@@ -727,7 +726,7 @@ DPXOutput::get_image_descriptor()
727726
728727
729728void
730- DPXOutput::set_keycode_values (int * array)
729+ DPXOutput::set_keycode_values (cspan< int > array)
731730{
732731 // Manufacturer code
733732 {
@@ -760,8 +759,8 @@ DPXOutput::set_keycode_values(int* array)
760759 }
761760
762761 // Format
763- int & perfsPerFrame = array[5 ];
764- int & perfsPerCount = array[6 ];
762+ int perfsPerFrame = array[5 ];
763+ int perfsPerCount = array[6 ];
765764
766765 if (perfsPerFrame == 15 && perfsPerCount == 120 ) {
767766 Strutil::safe_strcpy (m_dpx.header .format , " 8kimax" ,
0 commit comments