Opened 9 years ago
Closed 4 years ago
#9020 closed Bugs (duplicate)
kth_channel_view fails when used with virtual views
Reported by: | Owned by: | Stefan Seefeld | |
---|---|---|---|
Milestone: | To Be Determined | Component: | gil USE GITHUB |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | kth_channel_view virtual_2d_locator | Cc: | mateusz@… |
Description
Given an image_view with a virtual_2d_locator that returns a planar_pixel_reference, kth_channel_view produces a kth_channel_deref_fn with an incorrect result_type which may result an invalid pointer dereference.
For example, consider a virtual_2d_locator instantiated with a dereference functor that returns a 'planar_pixel_reference<bits8&, rgb_t>'
An image_view instantiated with such a locator will have a reference type of 'planar_pixel_reference<bits8&,rgb_t>'. Now suppose this image_view is passed to kth_channel_view(). This results in the instantiation of a kth_channel_deref_fn with a result_type of 'pixel<bits8&, gray_layout_t>&'; however, the deref functor will initialize this result_type with a pixel<bits8,gray_layout_t>&'.
detail::kth_channel_deref_fn needs to ensure the channel type of its result_type is not a reference type.
Attachments (2)
Change History (6)
by , 9 years ago
Attachment: | image_view_factory.hpp.patch added |
---|
comment:1 by , 9 years ago
Please retract this bug report. The proposed fix makes the kth_channel_view read-only for virtual views with reference types of planar_pixel_reference.
comment:2 by , 6 years ago
Cc: | added |
---|
comment:3 by , 5 years ago
Owner: | changed from | to
---|
comment:4 by , 4 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
patch to kth_channel_deref_fn in image_view_factory.hpp