misc/image: ImageRead: use vlc_format_Copy
commitce0d3b2c8be8126f272abe1c591d8a300a7ab190
authorFilip Roséen <filip@atch.se>
Sun, 21 May 2017 18:50:24 +0000 (21 20:50 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 21 May 2017 19:24:29 +0000 (21 22:24 +0300)
treee6351d5979d88ac2a8856ff2d5a8445da4685a50
parent911f67ecfdf89d89829a7380510db59df74d3f32
misc/image: ImageRead: use vlc_format_Copy

If the decoder allocates data within video_format_t.p_palette, the
previous implementation would result in a use-after-free (among other
issues) due to the ownership of said p_palette not being well-defined.

This fixes the issue by using video_format_Copy, so that the two fmts
do not refer to the same palette.

fixes: #18334

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
src/misc/image.c