graphics/timg: Fix build with ffmpeg 8
Taken from https://github.com/hzeller/timg/commit/158e46
PR: 289044