changeset 1719:73b23e9098a4

Disallow writes to lower-resolution thumbnails
author bert <bert>
date Mon, 29 Mar 2004 22:03:20 +0000
parents b89f3916bad7
children d6d963b34c9b
files libsrc2/hyper.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libsrc2/hyper.c
+++ b/libsrc2/hyper.c
@@ -371,6 +371,12 @@
 
     file_id = volume->hdf_id;
 
+    /* Disallow write operations to anything but the highest resolution.
+     */
+    if (opcode == MIRW_OP_WRITE && volume->selected_resolution != 0) {
+        return (MI_ERROR);
+    }
+
     if (midatatype == MI_TYPE_UNKNOWN) {
         type_id = H5Tcopy(volume->type_id);
     }
@@ -485,6 +491,12 @@
     int dir[MI2_MAX_VAR_DIMS];  /* Direction, 1 or -1, in file order */
     int n_different = 0;
 
+    /* Disallow write operations to anything but the highest resolution.
+     */
+    if (opcode == MIRW_OP_WRITE && volume->selected_resolution != 0) {
+        return (MI_ERROR);
+    }
+
     miicv_inqint(icv, MI_ICV_TYPE, &nc_type);
 
     nbytes = MI2typelen(nc_type);