gif: use the AVFrame API properly.