WRaster: Properly set file's mtime in the cache when loading an image
commitf2cd2c9f037174795b6183e62f2fcf6ee9b22739
authorChristophe CURIS <christophe.curis@free.fr>
Sun, 16 May 2021 13:47:10 +0000 (16 15:47 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Tue, 18 May 2021 16:49:17 +0000 (18 17:49 +0100)
tree5dfba16d28362d23a28e1f50ae8a35549a478632
parentd125f80dee009c1297cc63e4209f78c4524e7d9a
WRaster: Properly set file's mtime in the cache when loading an image

The library maintains a cache to not reload a file that was previously
loaded. In order to still reload an image in case its file would have
changed in the meantime, the cache saves the file's modification time.

As reported by Coverity (CID #331576) the 'stat' function was not on the
execution path the first time an image is loaded, which means the cache
information is populated with junk data. This could lead to an image not
being reloaded for example.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
wrlib/load.c