Moved from lapser's script thread:
https://chdk.setepontos.com/index.php?topic=13194.msg134620Looking at this a bit more, I don't think the error lapser saw was due to incorrect definition in CHDK, the script just has to ensure it doesn't go outside the active area.
If you can upload a CHDK DNG somewhere, I can double check.
The vertical size doesn't actually matter too much as long as it includes all the image data, and does not include memory that is used for something else.
The raw size and active area should be even to avoid ambiguity about dealing with half a CFA repetition. This is enforced for active area, but not currently for RAW_ROWS.
The M3 jpeg area is exactly the same as the active area. This will generate warnings in dng_validate because there are no pixels to interpolate at the edges, but seems to work OK in practice (it happens on any port if you change the default crop option to active or sensor.) If there are more valid image pixels outside the current active area, it could be expanded.