filex icon indicating copy to clipboard operation
filex copied to clipboard

missing fx_media_open_notify initialization without FX_DISABLE_FORCE_MEMORY_OPERATION defined

Open TheFlyvio opened this issue 2 years ago • 1 comments

when user does not need the open notification, the FX_DISABLE_FORCE_MEMORY_OPERATION is undefined and fx_media_open_notify_set(fx_media, NULL) is not called before the opening, the FX_MEDIA fx_media_open_notify attribute is never initialized, resulting in a potential hard fault.

Azure RTOS 6.3.0

Steps to reproduce the behavior:

  1. let FX_DISABLE_FORCE_MEMORY_OPERATION undefined
  2. do not call fx_media_open_notify_set
  3. create FX_MEDIA in the stack after some work was done and memory isnt only zeroes anymore
  4. open the media
  5. the "address" contained in fx_media_open_notify will be called

two ways it can be worked around -defining FX_DISABLE_FORCE_MEMORY_OPERATION
-before the opening, calling fx_media_open_notify_set with a function pointer or null

TheFlyvio avatar Nov 01 '23 16:11 TheFlyvio

Yes, this is a bug. Another workaround is defining FX_MEDIA as a global variable so that it contains all zeros.

xiuwencai avatar Dec 22 '23 06:12 xiuwencai