Garbage is displayed when zoom > 100% and flip != no
This is not recent regression, i was able to reproduce this on 1.4.2 too.
OpenCL: does not matter.
Other modules: does not matter.
Steps to reproduce:
1. Open image.
2. Zoom in (>100%, for me 125-200%)
3. Change image orientation (must be not "no rotation")
4. Move zoomed-in view (On some (reproducible) image places, correct image is displayed, on some - garbage)
5. Change zoom level
6. If image is still not garbled, repeat steps 3-6
I believe this is found only now because of PR584, although i suspect it was there from the beginning.
Because of this it should preferably be fixed before 1.6 release.
#5 Updated by Roman Lebedev over 4 years ago
AddressSanitizer: heap-buffer-overflow on address ... in amaze_demosaic_RT._omp_fn.10 /home/lebedevri/darktable/src/iop/amaze_demosaic_RT.cc:523
AddressSanitizer: heap-buffer-overflow on address ... in vng_interpolate /home/lebedevri/darktable/src/iop/demosaic.c:1169
AddressSanitizer: heap-buffer-overflow on address ... in amaze_demosaic_RT._omp_fn.10 /home/lebedevri/darktable/src/iop/amaze_demosaic_RT.cc:567
AddressSanitizer: heap-buffer-overflow on address ... in amaze_demosaic_RT._omp_fn.10 /home/lebedevri/darktable/src/iop/amaze_demosaic_RT.cc:557
AddressSanitizer: heap-buffer-overflow on address ... in vng_interpolate /home/lebedevri/darktable/src/iop/demosaic.c:1175
#6 Updated by Roman Lebedev over 4 years ago
- roi_in & roi_out arrive in VNG with a height of 0 just before the crash
- VNG4 always assumes height >= 4, thus it always crashes.
- PPG, it is basically a nop if height 0, hence it won't crash.
- Likewise Markesteijn is a nop if height 0, won't crash.
- VNG/Amaze can be patched to exit gracefully if height==0, but that'd just obscure the real issue... [unless solution is found before 1.6 this should probably be done (or disable zoom >100% :) )]
This means that the issue is in the core.
#8 Updated by Dan Torop over 4 years ago
- File zoom_scale.patch added
- % Done changed from 10 to 70
- Status changed from Confirmed to Patch attached
There's a try at a fix in https://github.com/dtorop/darktable/tree/zoom-crash-garbage or in attached patch. Still need to think about this more, though.
This seems to fix the garbage/crash in portrait images at zooms of just less than 200%. There's still another problem, that garbage gets displayed at 200% near the right side of the image.
#9 Updated by Dan Torop over 4 years ago
I made a PR for this patch, but am not totally happy about it. If someone can do better or have more sense of what's right, that is great.
The noise at the right side when viewing at 200% is still a problem. This seems to happen because flip's modify_roi_in() sees the scale as 1x, and hence its width/height values are not useful.